@@ -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);
@@ -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
}
@@ -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 */
@@ -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;
It is the only thing that is actually used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/huffyuvenc.c | 2 +- libavcodec/huffyuvencdsp.c | 4 ++-- libavcodec/huffyuvencdsp.h | 6 +++--- libavcodec/x86/huffyuvencdsp_init.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)