mirror of https://git.ffmpeg.org/ffmpeg.git
vc2enc: remove redundant put_padding() and use skip_put_bytes() instead
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
This commit is contained in:
parent
090621d7ce
commit
6061b78e83
|
@ -152,19 +152,6 @@ typedef struct VC2EncContext {
|
|||
enum DiracParseCodes last_parse_code;
|
||||
} VC2EncContext;
|
||||
|
||||
static av_always_inline void put_padding(PutBitContext *pb, int bytes)
|
||||
{
|
||||
int bits = bytes*8;
|
||||
if (!bits)
|
||||
return;
|
||||
while (bits > 31) {
|
||||
put_bits(pb, 31, 0);
|
||||
bits -= 31;
|
||||
}
|
||||
if (bits)
|
||||
put_bits(pb, bits, 0);
|
||||
}
|
||||
|
||||
static av_always_inline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
|
||||
{
|
||||
int i;
|
||||
|
@ -742,7 +729,7 @@ static int encode_hq_slice(AVCodecContext *avctx, void *arg)
|
|||
int p, level, orientation;
|
||||
|
||||
avpriv_align_put_bits(pb);
|
||||
put_padding(pb, s->prefix_bytes);
|
||||
skip_put_bytes(pb, s->prefix_bytes);
|
||||
put_bits(pb, 8, quant_idx);
|
||||
|
||||
/* Slice quantization (slice_quantizers() in the specs) */
|
||||
|
@ -773,7 +760,8 @@ static int encode_hq_slice(AVCodecContext *avctx, void *arg)
|
|||
pad_c = (pad_s*s->size_scaler) - bytes_len;
|
||||
}
|
||||
pb->buf[bytes_start] = pad_s;
|
||||
put_padding(pb, pad_c);
|
||||
flush_put_bits(pb);
|
||||
skip_put_bytes(pb, pad_c);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue