1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec, avfilter, avformat: Remove redundant avpriv_align_put_bits

flush_put_bits() already fills the bitstream with zeroes, so it is
unnecessary to align the bitstream before.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-07-30 21:44:51 +02:00
parent c67bdd6534
commit 8129c32e48
6 changed files with 1 additions and 7 deletions

View File

@ -113,10 +113,9 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
put_bits(&pb, 1, 0); // extension flag
put_bits(&pb, 1, 1); // stop bit
avpriv_align_put_bits(&pb);
flush_put_bits(&pb);
data_size = put_bits_count(&pb) / 8;
flush_put_bits(&pb);
return data_size;
}

View File

@ -2818,7 +2818,6 @@ static void write_slice_end(MpegEncContext *s){
ff_mjpeg_encode_stuffing(s);
}
avpriv_align_put_bits(&s->pb);
flush_put_bits(&s->pb);
if ((s->avctx->flags & AV_CODEC_FLAG_PASS1) && !s->partitioned_frame)

View File

@ -780,7 +780,6 @@ static int encode_slices(VC2EncContext *s)
int slice_x, slice_y, skip = 0;
SliceArgs *enc_args = s->slice_args;
avpriv_align_put_bits(&s->pb);
flush_put_bits(&s->pb);
buf = put_bits_ptr(&s->pb);

View File

@ -206,7 +206,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
// Enforce total height to be a multiple of 2
if (h->rects[0]->h & 1) {
put_xsub_rle(&pb, h->rects[0]->w, PADDING_COLOR);
avpriv_align_put_bits(&pb);
}
flush_put_bits(&pb);

View File

@ -559,7 +559,6 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi
}
}
avpriv_align_put_bits(&buf);
flush_put_bits(&buf);
fwrite(buffer, 1, put_bits_count(&buf)/8, f);
fclose(f);

View File

@ -211,7 +211,6 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt)
} else
avpriv_copy_bits(&bs, pkt->data, 8*pkt->size);
avpriv_align_put_bits(&bs);
flush_put_bits(&bs);
len = put_bits_count(&bs) >> 3;