You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/idctdsp: Only try to initialize xvid idct if it is used
This allows to remove checks from ff_xvid_idct_init() (and also the AVCodecContext* parameter). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -276,6 +276,10 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
|
||||
c->idct = ff_faanidct;
|
||||
c->perm_type = FF_IDCT_PERM_NONE;
|
||||
#endif /* CONFIG_FAANIDCT */
|
||||
#if CONFIG_MPEG4_DECODER
|
||||
} else if (avctx->idct_algo == FF_IDCT_XVID) {
|
||||
ff_xvid_idct_init(c);
|
||||
#endif
|
||||
} else { // accurate/default
|
||||
c->idct_put = ff_simple_idct_put_int16_8bit;
|
||||
c->idct_add = ff_simple_idct_add_int16_8bit;
|
||||
@ -289,9 +293,6 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
|
||||
c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_c;
|
||||
|
||||
if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID)
|
||||
ff_xvid_idct_init(c, avctx);
|
||||
|
||||
#if ARCH_AARCH64
|
||||
ff_idctdsp_init_aarch64(c, avctx, high_bit_depth);
|
||||
#elif ARCH_ARM
|
||||
|
@ -32,7 +32,6 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "avcodec.h"
|
||||
#include "idctdsp.h"
|
||||
#include "xvididct.h"
|
||||
|
||||
@ -330,13 +329,8 @@ static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
ff_add_pixels_clamped_c(block, dest, line_size);
|
||||
}
|
||||
|
||||
av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx)
|
||||
av_cold void ff_xvid_idct_init(IDCTDSPContext *c)
|
||||
{
|
||||
const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (high_bit_depth || avctx->lowres)
|
||||
return;
|
||||
|
||||
c->idct_put = xvid_idct_put;
|
||||
c->idct_add = xvid_idct_add;
|
||||
c->idct = ff_xvid_idct;
|
||||
|
@ -21,12 +21,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "idctdsp.h"
|
||||
|
||||
void ff_xvid_idct(int16_t *const in);
|
||||
|
||||
void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx);
|
||||
void ff_xvid_idct_init(IDCTDSPContext *c);
|
||||
|
||||
void ff_xvid_idct_init_x86(IDCTDSPContext *c);
|
||||
void ff_xvid_idct_init_mips(IDCTDSPContext *c);
|
||||
|
Reference in New Issue
Block a user