aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc2enc.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-03-01 11:38:19 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-03-01 11:39:30 +0000
commit6061b78e837428b0ed0923b2f52e4e36c003b489 (patch)
tree82ea89ff1e40845a141eb08ba2d97388842126ac /libavcodec/vc2enc.c
parent090621d7cece368d31f0d11baf477fc7fc007cac (diff)
downloadffmpeg-6061b78e837428b0ed0923b2f52e4e36c003b489.tar.gz
vc2enc: remove redundant put_padding() and use skip_put_bytes() instead
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/vc2enc.c')
-rw-r--r--libavcodec/vc2enc.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 953f01f068..5724d65af7 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -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;