You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/pixblockdsp: Pass bits_per_raw_sample directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -378,7 +378,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_asv_common_init(avctx);
|
||||
ff_fdctdsp_init(&a->fdsp, avctx);
|
||||
ff_pixblockdsp_init(&a->pdsp, avctx);
|
||||
ff_pixblockdsp_init(&a->pdsp, 8);
|
||||
|
||||
if (avctx->global_quality <= 0)
|
||||
avctx->global_quality = 4 * FF_QUALITY_SCALE;
|
||||
|
@ -119,7 +119,7 @@ int avcodec_dct_init(AVDCT *dsp)
|
||||
#if CONFIG_PIXBLOCKDSP
|
||||
{
|
||||
PixblockDSPContext pdsp;
|
||||
ff_pixblockdsp_init(&pdsp, avctx);
|
||||
ff_pixblockdsp_init(&pdsp, dsp->bits_per_sample);
|
||||
COPY(pdsp, get_pixels);
|
||||
COPY(pdsp, get_pixels_unaligned);
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
|
||||
ff_fdctdsp_init(&ctx->m.fdsp, avctx);
|
||||
ff_mpv_idct_init(&ctx->m.c);
|
||||
ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx);
|
||||
ff_pixblockdsp_init(&ctx->m.pdsp, avctx);
|
||||
ff_pixblockdsp_init(&ctx->m.pdsp, ctx->bit_depth);
|
||||
ff_dct_encode_init(&ctx->m);
|
||||
|
||||
if (ctx->profile != AV_PROFILE_DNXHD)
|
||||
|
@ -112,7 +112,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
|
||||
ff_fdctdsp_init(&fdsp, avctx);
|
||||
s->fdct[0] = fdsp.fdct;
|
||||
s->fdct[1] = fdsp.fdct248;
|
||||
ff_pixblockdsp_init(&s->pdsp, avctx);
|
||||
ff_pixblockdsp_init(&s->pdsp, 8);
|
||||
|
||||
#if !CONFIG_HARDCODED_TABLES
|
||||
{
|
||||
|
@ -1031,7 +1031,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
|
||||
init_unquantize(s, avctx);
|
||||
ff_fdctdsp_init(&s->fdsp, avctx);
|
||||
ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx);
|
||||
ff_pixblockdsp_init(&s->pdsp, avctx);
|
||||
ff_pixblockdsp_init(&s->pdsp, 8);
|
||||
ret = me_cmp_init(m, avctx);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "pixblockdsp.h"
|
||||
|
||||
static void get_pixels_16_c(int16_t *restrict block, const uint8_t *pixels,
|
||||
@ -85,10 +84,10 @@ static void diff_pixels_c(int16_t *restrict block, const uint8_t *s1,
|
||||
}
|
||||
}
|
||||
|
||||
av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
|
||||
av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, int bits_per_raw_sample)
|
||||
{
|
||||
const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8 &&
|
||||
avctx->bits_per_raw_sample <= 16;
|
||||
const unsigned high_bit_depth = bits_per_raw_sample > 8 &&
|
||||
bits_per_raw_sample <= 16;
|
||||
|
||||
c->diff_pixels_unaligned =
|
||||
c->diff_pixels = diff_pixels_c;
|
||||
|
@ -19,10 +19,9 @@
|
||||
#ifndef AVCODEC_PIXBLOCKDSP_H
|
||||
#define AVCODEC_PIXBLOCKDSP_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avcodec.h"
|
||||
|
||||
typedef struct PixblockDSPContext {
|
||||
void (*get_pixels)(int16_t *restrict block /* align 16 */,
|
||||
const uint8_t *pixels /* align 8 */,
|
||||
@ -41,7 +40,7 @@ typedef struct PixblockDSPContext {
|
||||
|
||||
} PixblockDSPContext;
|
||||
|
||||
void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx);
|
||||
void ff_pixblockdsp_init(PixblockDSPContext *c, int bits_per_raw_sample);
|
||||
void ff_pixblockdsp_init_aarch64(PixblockDSPContext *c,
|
||||
unsigned high_bit_depth);
|
||||
void ff_pixblockdsp_init_arm(PixblockDSPContext *c,
|
||||
|
@ -90,11 +90,8 @@ void checkasm_check_pixblockdsp(void)
|
||||
uint16_t *dst0 = (uint16_t *)dst0_;
|
||||
uint16_t *dst1 = (uint16_t *)dst1_;
|
||||
PixblockDSPContext h;
|
||||
AVCodecContext avctx = {
|
||||
.bits_per_raw_sample = 8,
|
||||
};
|
||||
|
||||
ff_pixblockdsp_init(&h, &avctx);
|
||||
ff_pixblockdsp_init(&h, 8);
|
||||
|
||||
if (check_func(h.get_pixels, "get_pixels"))
|
||||
check_get_pixels(uint8_t, 1);
|
||||
|
Reference in New Issue
Block a user