From: Andreas Rheinhardt <andreas.rheinha...@outlook.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- libavcodec/flvenc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index 8f07c3c778..184e688ebd 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -70,20 +70,23 @@ int ff_flv_encode_picture_header(MPVMainEncContext *const m) void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, int last) { + unsigned code; + int bits; if (level < 64) { // 7-bit level - put_bits(pb, 1, 0); - put_bits(pb, 1, last); - put_bits(pb, 6, run); - - put_sbits(pb, 7, slevel); + bits = 1 + 1 + 6 + 7; + code = (0 << (1 + 6 + 7)) | + (last << (6 + 7)) | + (run << 7) | + (slevel & 0x7f); } else { /* 11-bit level */ - put_bits(pb, 1, 1); - put_bits(pb, 1, last); - put_bits(pb, 6, run); - - put_sbits(pb, 11, slevel); + bits = 1 + 1 + 6 + 11; + code = (1 << (1 + 6 + 11)) | + (last << (6 + 11)) | + (run << 11) | + (slevel & 0x7ff); } + put_bits(pb, bits, code); } const FFCodec ff_flv_encoder = { -- ffmpeg-codebot _______________________________________________ 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".