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

snow: use hpeldsp instead of dsputil for half-pel functions.

This commit is contained in:
Ronald S. Bultje 2013-03-10 14:14:35 -07:00 committed by Michael Niedermayer
parent 05dd583426
commit 771ba8f206
4 changed files with 11 additions and 6 deletions

4
configure vendored
View File

@ -1799,8 +1799,8 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp" rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
shorten_decoder_select="golomb" shorten_decoder_select="golomb"
sipr_decoder_select="lsp" sipr_decoder_select="lsp"
snow_decoder_select="dsputil dwt h264qpel rangecoder" snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder"
snow_encoder_select="aandcttables dsputil dwt h264qpel error_resilience mpegvideoenc rangecoder" snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp error_resilience mpegvideoenc rangecoder"
sonic_decoder_select="golomb" sonic_decoder_select="golomb"
sonic_encoder_select="golomb" sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb" sonic_ls_encoder_select="golomb"

View File

@ -401,6 +401,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe
ff_dsputil_init(&s->dsp, avctx); ff_dsputil_init(&s->dsp, avctx);
ff_hpeldsp_init(&s->hdsp, avctx->flags);
ff_videodsp_init(&s->vdsp, 8); ff_videodsp_init(&s->vdsp, 8);
ff_dwt_init(&s->dwt); ff_dwt_init(&s->dwt);
ff_h264qpel_init(&s->h264qpel, 8); ff_h264qpel_init(&s->h264qpel, 8);
@ -431,11 +432,11 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
mcf(12,12) mcf(12,12)
#define mcfh(dx,dy)\ #define mcfh(dx,dy)\
s->dsp.put_pixels_tab [0][dy/4+dx/8]=\ s->hdsp.put_pixels_tab [0][dy/4+dx/8]=\
s->dsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\ s->hdsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\
mc_block_hpel ## dx ## dy ## 16;\ mc_block_hpel ## dx ## dy ## 16;\
s->dsp.put_pixels_tab [1][dy/4+dx/8]=\ s->hdsp.put_pixels_tab [1][dy/4+dx/8]=\
s->dsp.put_no_rnd_pixels_tab[1][dy/4+dx/8]=\ s->hdsp.put_no_rnd_pixels_tab[1][dy/4+dx/8]=\
mc_block_hpel ## dx ## dy ## 8; mc_block_hpel ## dx ## dy ## 8;
mcfh(0, 0) mcfh(0, 0)

View File

@ -23,6 +23,7 @@
#define AVCODEC_SNOW_H #define AVCODEC_SNOW_H
#include "dsputil.h" #include "dsputil.h"
#include "hpeldsp.h"
#include "snow_dwt.h" #include "snow_dwt.h"
#include "rangecoder.h" #include "rangecoder.h"
@ -109,6 +110,7 @@ typedef struct SnowContext{
AVCodecContext *avctx; AVCodecContext *avctx;
RangeCoder c; RangeCoder c;
DSPContext dsp; DSPContext dsp;
HpelDSPContext hdsp;
VideoDSPContext vdsp; VideoDSPContext vdsp;
H264QpelContext h264qpel; H264QpelContext h264qpel;
SnowDWTContext dwt; SnowDWTContext dwt;

View File

@ -1748,7 +1748,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
s->m.dsp= s->dsp; //move s->m.dsp= s->dsp; //move
s->m.hdsp = s->hdsp;
ff_init_me(&s->m); ff_init_me(&s->m);
s->hdsp = s->m.hdsp;
s->dsp= s->m.dsp; s->dsp= s->m.dsp;
} }