diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-30 04:07:51 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-01 16:12:14 +0200 |
commit | 9b3279b20198a46aae08c29c3b4c4ce75ff637ff (patch) | |
tree | b6744f3ddae395b8dfb8318bddfa8a99e9cd8c9b /libavcodec/mjpegenc_common.h | |
parent | f7d44804a6fe5c3ce29464553411e184eea6461a (diff) |
avcodec/mjpegenc: Fix files with slices > 1, but threads == 1
In the aforementioned case mpegvideo_enc.c calls
ff_mjpeg_encode_stuffing() at the end of every line which
pads the output to byte-alignment and escapes it;
yet it does not write the restart-markers (and also not
the DRI marker when writing the header) and so the output files
are broken.
Fix this by writing these markers depending upon the number of
slices and not the number of threads in use; this also makes
the output of the encoder reproducible given a slice count
and is therefore important if encoder tests that actually use
-threads auto are added in the future.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mjpegenc_common.h')
-rw-r--r-- | libavcodec/mjpegenc_common.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mjpegenc_common.h b/libavcodec/mjpegenc_common.h index ac753bf153..ba7c4f93fa 100644 --- a/libavcodec/mjpegenc_common.h +++ b/libavcodec/mjpegenc_common.h @@ -33,7 +33,8 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb, struct MJpegContext *m, ScanTable *intra_scantable, int pred, uint16_t luma_intra_matrix[64], - uint16_t chroma_intra_matrix[64]); + uint16_t chroma_intra_matrix[64], + int use_slices); void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits); void ff_mjpeg_escape_FF(PutBitContext *pb, int start); void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code, |