1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/huffyuvencdsp: Pass pix_fmt directly when initing dsp

It is the only thing that is actually used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-10-01 21:49:29 +02:00
parent 9ec50660ad
commit 1741adb1c7
4 changed files with 8 additions and 8 deletions

View File

@ -210,7 +210,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
ff_huffyuv_common_init(avctx);
ff_huffyuvencdsp_init(&s->hencdsp, avctx);
ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt);
ff_llvidencdsp_init(&s->llvidencdsp);
avctx->extradata = av_mallocz(3*MAX_N + 4);

View File

@ -68,12 +68,12 @@ static void sub_hfyu_median_pred_int16_c(uint16_t *dst, const uint16_t *src1, co
*left_top = lt;
}
av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx)
av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
{
c->diff_int16 = diff_int16_c;
c->sub_hfyu_median_pred_int16 = sub_hfyu_median_pred_int16_c;
#if ARCH_X86
ff_huffyuvencdsp_init_x86(c, avctx);
ff_huffyuvencdsp_init_x86(c, pix_fmt);
#endif
}

View File

@ -21,7 +21,7 @@
#include <stdint.h>
#include "avcodec.h"
#include "libavutil/pixfmt.h"
typedef struct HuffYUVEncDSPContext {
void (*diff_int16)(uint16_t *dst /* align 16 */,
@ -34,7 +34,7 @@ typedef struct HuffYUVEncDSPContext {
int w, int *left, int *left_top);
} HuffYUVEncDSPContext;
void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avctx);
void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx);
void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt);
void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt);
#endif /* AVCODEC_HUFFYUVENCDSP_H */

View File

@ -35,10 +35,10 @@ void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src
void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
unsigned mask, int w, int *left, int *left_top);
av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, AVCodecContext *avctx)
av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
{
av_unused int cpu_flags = av_get_cpu_flags();
const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt);
const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc && pix_desc->comp[0].depth<16) {
c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext;