You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/flvenc: Combine writing bits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -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,
|
void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level,
|
||||||
int run, int last)
|
int run, int last)
|
||||||
{
|
{
|
||||||
|
unsigned code;
|
||||||
|
int bits;
|
||||||
if (level < 64) { // 7-bit level
|
if (level < 64) { // 7-bit level
|
||||||
put_bits(pb, 1, 0);
|
bits = 1 + 1 + 6 + 7;
|
||||||
put_bits(pb, 1, last);
|
code = (0 << (1 + 6 + 7)) |
|
||||||
put_bits(pb, 6, run);
|
(last << (6 + 7)) |
|
||||||
|
(run << 7) |
|
||||||
put_sbits(pb, 7, slevel);
|
(slevel & 0x7f);
|
||||||
} else {
|
} else {
|
||||||
/* 11-bit level */
|
/* 11-bit level */
|
||||||
put_bits(pb, 1, 1);
|
bits = 1 + 1 + 6 + 11;
|
||||||
put_bits(pb, 1, last);
|
code = (1 << (1 + 6 + 11)) |
|
||||||
put_bits(pb, 6, run);
|
(last << (6 + 11)) |
|
||||||
|
(run << 11) |
|
||||||
put_sbits(pb, 11, slevel);
|
(slevel & 0x7ff);
|
||||||
}
|
}
|
||||||
|
put_bits(pb, bits, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FFCodec ff_flv_encoder = {
|
const FFCodec ff_flv_encoder = {
|
||||||
|
Reference in New Issue
Block a user