summaryrefslogtreecommitdiff
path: root/libavcodec/speedhqenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-29 23:46:17 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-01 16:10:33 +0200
commitf7d44804a6fe5c3ce29464553411e184eea6461a (patch)
treed7822036c7be39b97cac888ca2346120d26d6610 /libavcodec/speedhqenc.c
parent8ca4b515e73079cda068e253853654db394b8171 (diff)
avcodec/mjpegenc, speedhqenc: Remove nonsense assert
Our code for writing optimal huffman tables is incompatible with using multiple slices and hence commit 884506dfe2e29a5b2bd2905ca4f17e277e32acb1 that implemented this also added an assert that slice_context_count is always 1. Yet this was always wrong: a) The MJPEG-encoder has (and had) the AV_CODEC_CAP_SLICE_THREADS capability, so asserting that it always uses one slice context is incorrect. b) This commit did not add any proper checks that ensured that optimal huffman tables are never used together with multiple slices. This only happened with 03eb0515c12637dbd20c2e3ca8503d7b47cf583a. c) This assert is at the wrong place: ff_mjpeg_encode_init() is called before the actual slice_context_count is set. This is the reason why this assert was never triggered. Therefore this commit removes this assert. Also remove an assert from the SpeedHQ encoder sharing b) and c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/speedhqenc.c')
-rw-r--r--libavcodec/speedhqenc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 22213b823d..8dbb976248 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -90,8 +90,6 @@ av_cold int ff_speedhq_encode_init(MpegEncContext *s)
{
static AVOnce init_static_once = AV_ONCE_INIT;
- av_assert0(s->slice_context_count == 1);
-
if (s->width > 65500 || s->height > 65500) {
av_log(s, AV_LOG_ERROR, "SpeedHQ does not support resolutions above 65500x65500\n");
return AVERROR(EINVAL);