Merge remote-tracking branch 'qatar/master'

* qatar/master:
  intrax8: move functions from dsputil to own context

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-02 21:00:15 +02:00
commit 50b0edea9f
6 changed files with 62 additions and 34 deletions

View File

@ -2967,9 +2967,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
#if CONFIG_MLP_DECODER || CONFIG_TRUEHD_DECODER
ff_mlp_init(c, avctx);
#endif
#if CONFIG_WMV2_DECODER || CONFIG_VC1_DECODER
ff_intrax8dsp_init(c,avctx);
#endif
c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c;
c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c;

View File

@ -382,9 +382,6 @@ typedef struct DSPContext {
void (*h261_loop_filter)(uint8_t *src, int stride);
void (*x8_v_loop_filter)(uint8_t *src, int stride, int qscale);
void (*x8_h_loop_filter)(uint8_t *src, int stride, int qscale);
/* assume len is a multiple of 4, and arrays are 16-byte aligned */
void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
@ -499,11 +496,6 @@ typedef struct DSPContext {
unsigned int filter_shift, int32_t mask, int blocksize,
int32_t *sample_buffer);
/* intrax8 functions */
void (*x8_spatial_compensation[12])(uint8_t *src , uint8_t *dst, int linesize);
void (*x8_setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
int * range, int * sum, int edges);
/**
* Calculate scalar product of two vectors.
* @param len length of vectors, should be multiple of 16
@ -632,7 +624,6 @@ void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_dwt(DSPContext *c);
void ff_intrax8dsp_init(DSPContext* c, AVCodecContext *avctx);
void ff_mlp_init(DSPContext* c, AVCodecContext *avctx);
void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx);

View File

@ -28,6 +28,7 @@
#include "msmpeg4data.h"
#include "intrax8huf.h"
#include "intrax8.h"
#include "intrax8dsp.h"
#define MAX_TABLE_DEPTH(table_bits, max_bits) ((max_bits+table_bits-1)/table_bits)
@ -300,9 +301,9 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma
int sum;
int quant;
s->dsp.x8_setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer,
s->current_picture.f.linesize[chroma>0],
&range, &sum, w->edges);
w->dsp.setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer,
s->current_picture.f.linesize[chroma>0],
&range, &sum, w->edges);
if(chroma){
w->orient=w->chroma_orient;
quant=w->quant_dc_chroma;
@ -636,7 +637,7 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){
if(w->flat_dc){
dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
}else{
s->dsp.x8_spatial_compensation[w->orient]( s->edge_emu_buffer,
w->dsp.spatial_compensation[w->orient]( s->edge_emu_buffer,
s->dest[chroma],
s->current_picture.f.linesize[!!chroma] );
}
@ -656,10 +657,10 @@ block_placed:
int linesize = s->current_picture.f.linesize[!!chroma];
if(!( (w->edges&2) || ( zeros_only && (w->orient|4)==4 ) )){
s->dsp.x8_h_loop_filter(ptr, linesize, w->quant);
w->dsp.h_loop_filter(ptr, linesize, w->quant);
}
if(!( (w->edges&1) || ( zeros_only && (w->orient|8)==8 ) )){
s->dsp.x8_v_loop_filter(ptr, linesize, w->quant);
w->dsp.v_loop_filter(ptr, linesize, w->quant);
}
}
return 0;
@ -696,6 +697,8 @@ av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s
ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]);
ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]);
ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]);
ff_intrax8dsp_init(&w->dsp);
}
/**

View File

@ -21,6 +21,7 @@
#include "get_bits.h"
#include "mpegvideo.h"
#include "intrax8dsp.h"
typedef struct{
VLC * j_ac_vlc[4];//they point to the static j_mb_vlc
@ -33,6 +34,7 @@ typedef struct{
ScanTable scantable[3];
//set by the caller codec
MpegEncContext * s;
IntraX8DSPContext dsp;
int quant;
int dquant;
int qsum;

View File

@ -22,6 +22,7 @@
*/
#include "dsputil.h"
#include "intrax8dsp.h"
#include "libavutil/common.h"
/*
@ -412,20 +413,21 @@ static void x8_v_loop_filter(uint8_t *src, int stride, int qscale){
x8_loop_filter(src, 1, stride, qscale);
}
av_cold void ff_intrax8dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
dsp->x8_h_loop_filter=x8_h_loop_filter;
dsp->x8_v_loop_filter=x8_v_loop_filter;
dsp->x8_setup_spatial_compensation=x8_setup_spatial_compensation;
dsp->x8_spatial_compensation[0]=spatial_compensation_0;
dsp->x8_spatial_compensation[1]=spatial_compensation_1;
dsp->x8_spatial_compensation[2]=spatial_compensation_2;
dsp->x8_spatial_compensation[3]=spatial_compensation_3;
dsp->x8_spatial_compensation[4]=spatial_compensation_4;
dsp->x8_spatial_compensation[5]=spatial_compensation_5;
dsp->x8_spatial_compensation[6]=spatial_compensation_6;
dsp->x8_spatial_compensation[7]=spatial_compensation_7;
dsp->x8_spatial_compensation[8]=spatial_compensation_8;
dsp->x8_spatial_compensation[9]=spatial_compensation_9;
dsp->x8_spatial_compensation[10]=spatial_compensation_10;
dsp->x8_spatial_compensation[11]=spatial_compensation_11;
av_cold void ff_intrax8dsp_init(IntraX8DSPContext *dsp)
{
dsp->h_loop_filter=x8_h_loop_filter;
dsp->v_loop_filter=x8_v_loop_filter;
dsp->setup_spatial_compensation=x8_setup_spatial_compensation;
dsp->spatial_compensation[0]=spatial_compensation_0;
dsp->spatial_compensation[1]=spatial_compensation_1;
dsp->spatial_compensation[2]=spatial_compensation_2;
dsp->spatial_compensation[3]=spatial_compensation_3;
dsp->spatial_compensation[4]=spatial_compensation_4;
dsp->spatial_compensation[5]=spatial_compensation_5;
dsp->spatial_compensation[6]=spatial_compensation_6;
dsp->spatial_compensation[7]=spatial_compensation_7;
dsp->spatial_compensation[8]=spatial_compensation_8;
dsp->spatial_compensation[9]=spatial_compensation_9;
dsp->spatial_compensation[10]=spatial_compensation_10;
dsp->spatial_compensation[11]=spatial_compensation_11;
}

33
libavcodec/intrax8dsp.h Normal file
View File

@ -0,0 +1,33 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_INTRAX8DSP_H
#define AVCODEC_INTRAX8DSP_H
typedef struct IntraX8DSPContext {
void (*v_loop_filter)(uint8_t *src, int stride, int qscale);
void (*h_loop_filter)(uint8_t *src, int stride, int qscale);
void (*spatial_compensation[12])(uint8_t *src , uint8_t *dst, int linesize);
void (*setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
int *range, int *sum, int edges);
} IntraX8DSPContext;
void ff_intrax8dsp_init(IntraX8DSPContext *dsp);
#endif /* AVCODEC_INTRAX8DSP_H */