aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/proresdsp.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-02-24 11:35:33 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-02-27 15:30:12 +0100
commit57d892bd7b22ecf7e29a394c95dc19487cb84dbb (patch)
tree0fc1249ea6f02988ce991f396dcf912f7d81029b /libavcodec/proresdsp.c
parent90ed5ddf664f8c22626ab04b96bb9f6de95d4723 (diff)
downloadffmpeg-57d892bd7b22ecf7e29a394c95dc19487cb84dbb.tar.gz
avcodec/prores{dec,dsp}: Remove always-false checks
avctx->bits_per_raw_sample is always 10 or 12 here; the checks have been added in preparation for making bits_per_raw_sample user-settable via an AVOption, but this never happened. While just at it, also set unpack_alpha earlier (where bits_per_raw_sample is set). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/proresdsp.c')
-rw-r--r--libavcodec/proresdsp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index bc253e55f7..d20b9d938a 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "libavutil/attributes.h"
+#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "idctdsp.h"
#include "proresdsp.h"
@@ -76,16 +77,15 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo
put_pixels_12(out, linesize >> 1, block);
}
-av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
+av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
{
if (bits_per_raw_sample == 10) {
dsp->idct_put = prores_idct_put_10_c;
dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
- } else if (bits_per_raw_sample == 12) {
+ } else {
+ av_assert1(bits_per_raw_sample == 12);
dsp->idct_put = prores_idct_put_12_c;
dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
- } else {
- return AVERROR_BUG;
}
#if ARCH_X86
@@ -94,5 +94,4 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
ff_init_scantable_permutation(dsp->idct_permutation,
dsp->idct_permutation_type);
- return 0;
}