summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-03-31 00:21:20 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-10 03:45:18 +0200
commitd0dcfaef517105cf5f43f686bf2827c412c351ab (patch)
tree2d17a20a46f2b329af0c276b39cdbc4e799c7eb5 /libavcodec/mjpegenc.c
parentb3a38eaff492a64370092e6ff7d780199cebc68b (diff)
avcodec/mjpegenc: Remove dependency of AMV encoder on mjpegenc_huffman
Using optimal Huffman tables is not supported for AMV and always disabled by ff_mpv_encode_init(); therefore one can build the AMV encoder without mjpegenc_huffman if one adds the necessary compile-time checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r--libavcodec/mjpegenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 596b7544ca..e5d2e24d66 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -65,6 +65,7 @@ static av_cold void init_uni_ac_vlc(const uint8_t huff_size_ac[256],
}
}
+#if CONFIG_MJPEG_ENCODER
/**
* Encodes and outputs the entire frame in the JPEG format.
*
@@ -171,6 +172,7 @@ static void mjpeg_build_optimal_huffman(MJpegContext *m)
m->bits_ac_chrominance,
m->val_ac_chrominance);
}
+#endif
/**
* Writes the complete JPEG frame when optimal huffman tables are enabled,
@@ -186,11 +188,11 @@ int ff_mjpeg_encode_stuffing(MpegEncContext *s)
PutBitContext *pbc = &s->pb;
int mb_y = s->mb_y - !s->mb_x;
int ret;
- MJpegContext *m;
-
- m = s->mjpeg_ctx;
+#if CONFIG_MJPEG_ENCODER
if (s->huffman == HUFFMAN_TABLE_OPTIMAL) {
+ MJpegContext *m = s->mjpeg_ctx;
+
mjpeg_build_optimal_huffman(m);
// Replace the VLCs with the optimal ones.
@@ -206,6 +208,7 @@ int ff_mjpeg_encode_stuffing(MpegEncContext *s)
s->pred, s->intra_matrix, s->chroma_intra_matrix);
mjpeg_encode_picture_frame(s);
}
+#endif
ret = ff_mpv_reallocate_putbitbuffer(s, put_bits_count(&s->pb) / 8 + 100,
put_bits_count(&s->pb) / 4 + 1000);