Skip to content

Commit

Permalink
--temporal-layersをHEVCでも使用可能に。 ( #112 )
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed Dec 3, 2024
1 parent 1ac7ad2 commit ddc9825
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VCECore/vce_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ tstring encoder_help() {
_T(" - q-pel (best) = default\n")
_T(" --vbaq [H.264/HEVC] enable VBAQ (default: auto)\n")
_T(" --tiles <int> [AV1] set num of tiles per frame\n")
_T(" --temporal-layers <int> [AV1] set num of temporal layers\n")
_T(" --temporal-layers <int> [HEVC/AV1] set num of temporal layers\n")
_T(" --aq-mode <string> [AV1] set AQ mode\n")
_T(" - none\n")
_T(" - caq\n")
Expand Down
10 changes: 5 additions & 5 deletions VCECore/vce_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,7 @@ RGY_ERR VCECore::initEncoder(VCEParam *prm) {
vbv_bufsize_kbps = max_bitrate_kbps;
} else {
max_bitrate_kbps = VCE_DEFAULT_MAX_BITRATE;
vbv_bufsize_kbps = VCE_DEFAULT_VBV_BUFSIZE;
vbv_bufsize_kbps = VCE_DEFAULT_MAX_BITRATE;
}
if (prm->codecParam[prm->codec].nLevel == 0) {
prm->codecParam[prm->codec].nLevel = (int16_t)level;
Expand Down Expand Up @@ -2425,6 +2425,10 @@ RGY_ERR VCECore::initEncoder(VCEParam *prm) {

if (prm->codec == RGY_CODEC_HEVC || prm->codec == RGY_CODEC_AV1) {
m_params.SetParam(AMF_PARAM_COLOR_BIT_DEPTH(prm->codec), (amf_int64)prm->outputDepth);
if (prm->temporalLayers.has_value()) {
m_params.SetParam(AMF_PARAM_MAX_NUM_TEMPORAL_LAYERS(prm->codec), (amf_int64)prm->temporalLayers.value());
m_params.SetParam(AMF_PARAM_NUM_TEMPORAL_LAYERS(prm->codec), (amf_int64)prm->temporalLayers.value());
}
}

if (prm->codec == RGY_CODEC_H264) {
Expand Down Expand Up @@ -2504,10 +2508,6 @@ RGY_ERR VCECore::initEncoder(VCEParam *prm) {
if (prm->tiles > 0) {
m_params.SetParam(AMF_VIDEO_ENCODER_AV1_TILES_PER_FRAME, (amf_int64)prm->tiles);
}
if (prm->temporalLayers.has_value()) {
m_params.SetParam(AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS, (amf_int64)prm->temporalLayers.value());
m_params.SetParam(AMF_VIDEO_ENCODER_AV1_NUM_TEMPORAL_LAYERS, (amf_int64)prm->temporalLayers.value());
}
if (prm->cdefMode.has_value()) {
m_params.SetParam(AMF_VIDEO_ENCODER_AV1_CDEF_MODE, (amf_int64)prm->cdefMode.value());
}
Expand Down
2 changes: 2 additions & 0 deletions VCECore/vce_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ AMF_PARAM_H264_HEVC(END_OF_SEQUENCE);
AMF_PARAM_H264_HEVC(FORCE_PICTURE_TYPE);
AMF_PARAM_H264_HEVC(INSERT_AUD);
AMF_PARAM_HEVC_AV1(COLOR_BIT_DEPTH);
AMF_PARAM_HEVC_AV1(NUM_TEMPORAL_LAYERS);
AMF_PARAM_HEVC_AV1(MAX_NUM_TEMPORAL_LAYERS);
AMF_PARAM(QVBR_QUALITY_LEVEL);
AMF_PARAM(INPUT_COLOR_PROFILE);
AMF_PARAM(INPUT_TRANSFER_CHARACTERISTIC);
Expand Down
4 changes: 2 additions & 2 deletions VCEEncC_Options.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
- [--screen-content-tools \[\<param1\>=\<value1\>\[,\<param2\>=\<value2\>\]...\]](#--screen-content-tools--param1value1param2value2)
- [--cdf-update \[AV1\]](#--cdf-update-av1)
- [--cdf-frame-end-update \[AV1\]](#--cdf-frame-end-update-av1)
- [--temporal-layers \<int\> \[AV1\]](#--temporal-layers-int-av1)
- [--temporal-layers \<int\> \[HEVC/AV1\]](#--temporal-layers-int-hevcav1)
- [--aq-mode \<string\> \[AV1\]](#--aq-mode-string-av1)
- [--pe](#--pe)
- [--pa \[\<param1\>=\<value1\>\[,\<param2\>=\<value2\>\]...\]](#--pa--param1value1param2value2)
Expand Down Expand Up @@ -603,7 +603,7 @@ Enable CDF update.
### --cdf-frame-end-update [AV1]
Enable CDF frame end update.

### --temporal-layers &lt;int&gt; [AV1]
### --temporal-layers &lt;int&gt; [HEVC/AV1]
Number of temporal layers.

### --aq-mode &lt;string&gt; [AV1]
Expand Down
4 changes: 2 additions & 2 deletions VCEEncC_Options.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
- [--screen-content-tools \[\<param1\>=\<value1\>\[,\<param2\>=\<value2\>\]...\]](#--screen-content-tools--param1value1param2value2)
- [--cdf-update \[AV1\]](#--cdf-update-av1)
- [--cdf-frame-end-update \[AV1\]](#--cdf-frame-end-update-av1)
- [--temporal-layers \<int\> \[AV1\]](#--temporal-layers-int-av1)
- [--temporal-layers \<int\> \[HEVC/AV1\]](#--temporal-layers-int-hevcav1)
- [--aq-mode \<string\> \[AV1\]](#--aq-mode-string-av1)
- [--pe](#--pe)
- [--pa \[\<param1\>=\<value1\>\[,\<param2\>=\<value2\>\]...\]](#--pa--param1value1param2value2)
Expand Down Expand Up @@ -543,7 +543,7 @@ Enable CDF update.
### --cdf-frame-end-update [AV1]
Enable CDF frame end update.

### --temporal-layers &lt;int&gt; [AV1]
### --temporal-layers &lt;int&gt; [HEVC/AV1]
Temporal layersの数。

### --aq-mode &lt;string&gt; [AV1]
Expand Down

0 comments on commit ddc9825

Please sign in to comment.