Commit edd305ed authored by Limin Wang's avatar Limin Wang

avcodec/libopenh264enc: set iEntropyCodingModeFlag by coder option

For high/main profile, user can choose to use cavlc by specify "-coder cavlc",
for default, it'll will use cabac, if it's baseline, we'll use cavlc by specs anyway.

ffmpeg -y -f lavfi -i testsrc -c:v libopenh264 -profile:v main -coder cavlc -frames:v 1 -bsf trace_headers -f null -
before the patch:
entropy_coding_mode_flag                                    0 = 1

after the patch:
entropy_coding_mode_flag                                    0 = 0
Reviewed-by: 's avatarMartin Storsjö <martin@martin.st>
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
parent f74e90c2
......@@ -193,7 +193,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
#endif
param.bPrefixNalAddingCtrl = 0;
param.iLoopFilterDisableIdc = !s->loopfilter;
param.iEntropyCodingModeFlag = 0;
param.iEntropyCodingModeFlag = s->coder >= 0 ? s->coder : 1;
param.iMultipleThreadIdc = avctx->thread_count;
/* Allow specifying the libopenh264 profile through AVCodecContext. */
......@@ -221,14 +221,14 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
switch (s->profile) {
case FF_PROFILE_H264_HIGH:
param.iEntropyCodingModeFlag = 1;
av_log(avctx, AV_LOG_VERBOSE, "Using CABAC, "
"select EProfileIdc PRO_HIGH in libopenh264.\n");
av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_HIGH in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break;
case FF_PROFILE_H264_MAIN:
param.iEntropyCodingModeFlag = 1;
av_log(avctx, AV_LOG_VERBOSE, "Using CABAC, "
"select EProfileIdc PRO_MAIN in libopenh264.\n");
av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_MAIN in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE:
case FF_PROFILE_UNKNOWN:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment