Re: [FFmpeg-devel] [PATCH 3/3] avcodec/libopenh264enc: set iEntropyCodingModeFlag by coder option
On Fri, Jan 14, 2022 at 12:01:26AM +0200, Martin Storsjö wrote: > On Thu, 13 Jan 2022, lance.lmw...@gmail.com wrote: > > > From: Limin Wang > > > > 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_flag0 = 1 > > > > after the patch: > > entropy_coding_mode_flag0 = 0 > > I don't understand what this bit in the commit message tries to say? > > > Doesn't this patch have the effect, that if I only specify "-profile high", > I'll end up with CAVLC unless I specifically pass "-coder cabac" too? If > coder wasn't specified, I think we should still default to CABAC for > main/high. Sorry, I'll update the message. it's high profile, we can't to use cavlc even if specify -coder. Yes, if haven't set coder, it's preferable to enable cabac for high. > > // Martin > -- Thanks, Limin Wang ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 3/3] avcodec/libopenh264enc: set iEntropyCodingModeFlag by coder option
On Thu, 13 Jan 2022, lance.lmw...@gmail.com wrote: From: Limin Wang 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_flag0 = 1 after the patch: entropy_coding_mode_flag0 = 0 I don't understand what this bit in the commit message tries to say? Doesn't this patch have the effect, that if I only specify "-profile high", I'll end up with CAVLC unless I specifically pass "-coder cabac" too? If coder wasn't specified, I think we should still default to CABAC for main/high. // Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/3] avcodec/libopenh264enc: set iEntropyCodingModeFlag by coder option
From: Limin Wang 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_flag0 = 1 after the patch: entropy_coding_mode_flag0 = 0 Signed-off-by: Limin Wang --- libavcodec/libopenh264enc.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 995ee37..91deb6c 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -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 : 0; param.iMultipleThreadIdc = avctx->thread_count; /* Allow specifying the libopenh264 profile through AVCodecContext. */ @@ -222,15 +222,15 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) switch (s->profile) { case FF_PROFILE_H264_HIGH: s->profile = PRO_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", +s->coder == 1 ? "CABAC" : "CAVLC"); break; case FF_PROFILE_H264_MAIN: s->profile = PRO_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", +s->coder == 1 ? "CABAC" : "CAVLC"); break; case FF_PROFILE_H264_CONSTRAINED_BASELINE: case FF_PROFILE_UNKNOWN: -- 1.8.3.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".