diff options
author | Emeric Grange <emeric.grange@gmail.com> | 2012-01-18 18:23:08 +0100 |
---|---|---|
committer | Emeric Grange <emeric.grange@gmail.com> | 2012-06-24 16:57:32 +0200 |
commit | 28a7dc7d38526c5ac9fc0b5078eaf5a51562362d (patch) | |
tree | 59c2248db19f8c9b5b1629f3de5de4f12f8c1239 | |
parent | c2e55f9a933a75d69ffd6a5ec3dcfabef4c288f6 (diff) |
g3dvl: Move around a lot of code, rename some files to increase global coherence
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
19 files changed, 317 insertions, 334 deletions
diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index a06cd13a93..86e6496d44 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -161,7 +161,6 @@ C_SOURCES := \ vl/vp8/common/entropymv.c \ vl/vp8/common/filter.c \ vl/vp8/common/findnearmv.c \ - vl/vp8/common/idctllm.c \ vl/vp8/common/invtrans.c \ vl/vp8/common/quant_common.c \ vl/vp8/common/recon.c \ @@ -174,7 +173,7 @@ C_SOURCES := \ vl/vp8/decoder/decodemv.c \ vl/vp8/decoder/dequantize.c \ vl/vp8/decoder/detokenize.c \ - vl/vp8/decoder/idct_blk.c \ + vl/vp8/decoder/idct.c \ vl/vp8/decoder/onyxd_if.c \ vl/vp8/decoder/treereader.c diff --git a/src/gallium/auxiliary/vl/vp8/common/invtrans.h b/src/gallium/auxiliary/vl/vp8/common/invtrans.h index cc46301263..145821418c 100644 --- a/src/gallium/auxiliary/vl/vp8/common/invtrans.h +++ b/src/gallium/auxiliary/vl/vp8/common/invtrans.h @@ -12,7 +12,7 @@ #ifndef INVTRANS_H #define INVTRANS_H -#include "idct.h" +#include "../decoder/idct_dispatch.h" #include "blockd.h" extern void vp8_inverse_transform_b(const vp8_idct_rtcd_vtable_t *rtcd, BLOCKD *b, int pitch); diff --git a/src/gallium/auxiliary/vl/vp8/common/onyxc_int.h b/src/gallium/auxiliary/vl/vp8/common/onyxc_int.h index 3d4ba58552..77691348a4 100644 --- a/src/gallium/auxiliary/vl/vp8/common/onyxc_int.h +++ b/src/gallium/auxiliary/vl/vp8/common/onyxc_int.h @@ -15,8 +15,8 @@ #include "../vp8_debug.h" #include "entropymv.h" #include "entropy.h" -#include "idct.h" -#include "recon.h" +#include "../decoder/idct_dispatch.h" +#include "recon_dispatch.h" #define MINQ 0 #define MAXQ 127 diff --git a/src/gallium/auxiliary/vl/vp8/common/recon.c b/src/gallium/auxiliary/vl/vp8/common/recon.c index ba40a432ae..ac87c9c461 100644 --- a/src/gallium/auxiliary/vl/vp8/common/recon.c +++ b/src/gallium/auxiliary/vl/vp8/common/recon.c @@ -10,7 +10,6 @@ #include "recon.h" -#include "blockd.h" void vp8_recon_b_c(unsigned char *pred_ptr, short *diff_ptr, diff --git a/src/gallium/auxiliary/vl/vp8/common/recon.h b/src/gallium/auxiliary/vl/vp8/common/recon.h index 482a2edbab..26201e7362 100644 --- a/src/gallium/auxiliary/vl/vp8/common/recon.h +++ b/src/gallium/auxiliary/vl/vp8/common/recon.h @@ -13,112 +13,27 @@ #define RECON_H #include "blockd.h" +#include "recon_dispatch.h" -#define prototype_copy_block(sym) \ - void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch) +void vp8_recon_b_c(unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride); -#define prototype_recon_block(sym) \ - void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch) +void vp8_recon4b_c(unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride); -#define prototype_recon_macroblock(sym) \ - void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x) +void vp8_recon2b_c(unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride); -#define prototype_build_intra_predictors(sym) void sym(MACROBLOCKD *x) +void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, + MACROBLOCKD *x); -#define prototype_intra4x4_predict(sym) \ - void sym(BLOCKD *x, int b_mode, unsigned char *predictor) - -struct vp8_recon_rtcd_vtable; - -#ifndef vp8_recon_copy16x16 -#define vp8_recon_copy16x16 vp8_copy_mem16x16_c -#endif -extern prototype_copy_block(vp8_recon_copy16x16); - -#ifndef vp8_recon_copy8x8 -#define vp8_recon_copy8x8 vp8_copy_mem8x8_c -#endif -extern prototype_copy_block(vp8_recon_copy8x8); - -#ifndef vp8_recon_copy8x4 -#define vp8_recon_copy8x4 vp8_copy_mem8x4_c -#endif -extern prototype_copy_block(vp8_recon_copy8x4); - -#ifndef vp8_recon_recon -#define vp8_recon_recon vp8_recon_b_c -#endif -extern prototype_recon_block(vp8_recon_recon); - -#ifndef vp8_recon_recon2 -#define vp8_recon_recon2 vp8_recon2b_c -#endif -extern prototype_recon_block(vp8_recon_recon2); - -#ifndef vp8_recon_recon4 -#define vp8_recon_recon4 vp8_recon4b_c -#endif -extern prototype_recon_block(vp8_recon_recon4); - -#ifndef vp8_recon_recon_mb -#define vp8_recon_recon_mb vp8_recon_mb_c -#endif -extern prototype_recon_macroblock(vp8_recon_recon_mb); - -#ifndef vp8_recon_recon_mby -#define vp8_recon_recon_mby vp8_recon_mby_c -#endif -extern prototype_recon_macroblock(vp8_recon_recon_mby); - -#ifndef vp8_recon_build_intra_predictors_mby -#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby -#endif -extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mby); - -#ifndef vp8_recon_build_intra_predictors_mby_s -#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s -#endif -extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mby_s); - -#ifndef vp8_recon_build_intra_predictors_mbuv -#define vp8_recon_build_intra_predictors_mbuv vp8_build_intra_predictors_mbuv -#endif -extern prototype_build_intra_predictor(vp8_recon_build_intra_predictors_mbuv); - -#ifndef vp8_recon_build_intra_predictors_mbuv_s -#define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s -#endif -extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mbuv_s); - -#ifndef vp8_recon_intra4x4_predict -#define vp8_recon_intra4x4_predict vp8_intra4x4_predict -#endif -extern prototype_intra4x4_predict(vp8_recon_intra4x4_predict); - -typedef prototype_copy_block((*vp8_copy_block_fn_t)); -typedef prototype_recon_block((*vp8_recon_fn_t)); -typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t)); -typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t)); -typedef prototype_intra4x4_predict((*vp8_intra4x4_pred_fn_t)); -typedef struct vp8_recon_rtcd_vtable -{ - vp8_copy_block_fn_t copy16x16; - vp8_copy_block_fn_t copy8x8; - vp8_copy_block_fn_t copy8x4; - vp8_recon_fn_t recon; - vp8_recon_fn_t recon2; - vp8_recon_fn_t recon4; - vp8_recon_mb_fn_t recon_mb; - vp8_recon_mb_fn_t recon_mby; - vp8_build_intra_pred_fn_t build_intra_predictors_mby_s; - vp8_build_intra_pred_fn_t build_intra_predictors_mby; - vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s; - vp8_build_intra_pred_fn_t build_intra_predictors_mbuv; - vp8_intra4x4_pred_fn_t intra4x4_predict; -} vp8_recon_rtcd_vtable_t; - -#define RECON_INVOKE(ctx,fn) vp8_recon_##fn - -void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x); +void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, + MACROBLOCKD *x); #endif /* RECON_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/recon_dispatch.h b/src/gallium/auxiliary/vl/vp8/common/recon_dispatch.h new file mode 100644 index 0000000000..aee90a284d --- /dev/null +++ b/src/gallium/auxiliary/vl/vp8/common/recon_dispatch.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +#ifndef RECON_DISPATCH_H +#define RECON_DISPATCH_H + +#include "blockd.h" + +#define prototype_copy_block(sym) \ + void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch) + +#define prototype_recon_block(sym) \ + void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch) + +#define prototype_recon_macroblock(sym) \ + void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x) + +#define prototype_build_intra_predictors(sym) void sym(MACROBLOCKD *x) + +#define prototype_intra4x4_predict(sym) \ + void sym(BLOCKD *x, int b_mode, unsigned char *predictor) + +struct vp8_recon_rtcd_vtable; + +#ifndef vp8_recon_copy16x16 +#define vp8_recon_copy16x16 vp8_copy_mem16x16_c +#endif +extern prototype_copy_block(vp8_recon_copy16x16); + +#ifndef vp8_recon_copy8x8 +#define vp8_recon_copy8x8 vp8_copy_mem8x8_c +#endif +extern prototype_copy_block(vp8_recon_copy8x8); + +#ifndef vp8_recon_copy8x4 +#define vp8_recon_copy8x4 vp8_copy_mem8x4_c +#endif +extern prototype_copy_block(vp8_recon_copy8x4); + +#ifndef vp8_recon_recon +#define vp8_recon_recon vp8_recon_b_c +#endif +extern prototype_recon_block(vp8_recon_recon); + +#ifndef vp8_recon_recon2 +#define vp8_recon_recon2 vp8_recon2b_c +#endif +extern prototype_recon_block(vp8_recon_recon2); + +#ifndef vp8_recon_recon4 +#define vp8_recon_recon4 vp8_recon4b_c +#endif +extern prototype_recon_block(vp8_recon_recon4); + +#ifndef vp8_recon_recon_mb +#define vp8_recon_recon_mb vp8_recon_mb_c +#endif +extern prototype_recon_macroblock(vp8_recon_recon_mb); + +#ifndef vp8_recon_recon_mby +#define vp8_recon_recon_mby vp8_recon_mby_c +#endif +extern prototype_recon_macroblock(vp8_recon_recon_mby); + +#ifndef vp8_recon_build_intra_predictors_mby +#define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby +#endif +extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mby); + +#ifndef vp8_recon_build_intra_predictors_mby_s +#define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s +#endif +extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mby_s); + +#ifndef vp8_recon_build_intra_predictors_mbuv +#define vp8_recon_build_intra_predictors_mbuv vp8_build_intra_predictors_mbuv +#endif +extern prototype_build_intra_predictor(vp8_recon_build_intra_predictors_mbuv); + +#ifndef vp8_recon_build_intra_predictors_mbuv_s +#define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s +#endif +extern prototype_build_intra_predictors(vp8_recon_build_intra_predictors_mbuv_s); + +#ifndef vp8_recon_intra4x4_predict +#define vp8_recon_intra4x4_predict vp8_intra4x4_predict +#endif +extern prototype_intra4x4_predict(vp8_recon_intra4x4_predict); + +typedef prototype_copy_block((*vp8_copy_block_fn_t)); +typedef prototype_recon_block((*vp8_recon_fn_t)); +typedef prototype_recon_macroblock((*vp8_recon_mb_fn_t)); +typedef prototype_build_intra_predictors((*vp8_build_intra_pred_fn_t)); +typedef prototype_intra4x4_predict((*vp8_intra4x4_pred_fn_t)); + +typedef struct vp8_recon_rtcd_vtable +{ + vp8_copy_block_fn_t copy16x16; + vp8_copy_block_fn_t copy8x8; + vp8_copy_block_fn_t copy8x4; + + vp8_recon_fn_t recon; + vp8_recon_fn_t recon2; + vp8_recon_fn_t recon4; + vp8_recon_mb_fn_t recon_mb; + vp8_recon_mb_fn_t recon_mby; + + vp8_build_intra_pred_fn_t build_intra_predictors_mby_s; + vp8_build_intra_pred_fn_t build_intra_predictors_mby; + vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s; + vp8_build_intra_pred_fn_t build_intra_predictors_mbuv; + vp8_intra4x4_pred_fn_t intra4x4_predict; +} vp8_recon_rtcd_vtable_t; + +#define RECON_INVOKE(ctx,fn) vp8_recon_##fn + +#endif /* RECON_DISPATCH_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/reconinter.c b/src/gallium/auxiliary/vl/vp8/common/reconinter.c index 03837bfea8..850a4a74a9 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconinter.c +++ b/src/gallium/auxiliary/vl/vp8/common/reconinter.c @@ -9,7 +9,7 @@ */ -#include "recon.h" +#include "recon_dispatch.h" #include "filter_dispatch.h" #include "blockd.h" #include "reconinter.h" diff --git a/src/gallium/auxiliary/vl/vp8/common/reconintra.c b/src/gallium/auxiliary/vl/vp8/common/reconintra.c index 914d7d4589..de846930de 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconintra.c +++ b/src/gallium/auxiliary/vl/vp8/common/reconintra.c @@ -9,7 +9,7 @@ */ -#include "recon.h" +#include "recon_dispatch.h" #include "reconintra.h" #include "../vp8_mem.h" diff --git a/src/gallium/auxiliary/vl/vp8/common/reconintra.h b/src/gallium/auxiliary/vl/vp8/common/reconintra.h index a5ffd79700..6e5b1f7d7e 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconintra.h +++ b/src/gallium/auxiliary/vl/vp8/common/reconintra.h @@ -15,4 +15,7 @@ extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf); +void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, + MACROBLOCKD *x); + #endif /* RECONINTRA_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c b/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c index 77a191f793..bfff2d9955 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c +++ b/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c @@ -9,8 +9,7 @@ */ -#include "../vp8_mem.h" -#include "recon.h" +#include "recon_dispatch.h" #include "reconintra.h" void vp8_intra4x4_predict(BLOCKD *x, int b_mode, unsigned char *predictor) @@ -87,7 +86,6 @@ void vp8_intra4x4_predict(BLOCKD *x, int b_mode, unsigned char *predictor) { for (c = 0; c < 4; c++) { - predictor[c] = ap[c]; } diff --git a/src/gallium/auxiliary/vl/vp8/common/subpixel.h b/src/gallium/auxiliary/vl/vp8/common/subpixel.h deleted file mode 100644 index 9c8ee88165..0000000000 --- a/src/gallium/auxiliary/vl/vp8/common/subpixel.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -#ifndef SUBPIXEL_H -#define SUBPIXEL_H - -#define prototype_subpixel_predict(sym) \ - void sym(unsigned char *src, int src_pitch, int xofst, int yofst, \ - unsigned char *dst, int dst_pitch) - -#ifndef vp8_subpix_sixtap16x16 -#define vp8_subpix_sixtap16x16 vp8_sixtap_predict16x16_c -#endif -extern prototype_subpixel_predict(vp8_subpix_sixtap16x16); - -#ifndef vp8_subpix_sixtap8x8 -#define vp8_subpix_sixtap8x8 vp8_sixtap_predict8x8_c -#endif -extern prototype_subpixel_predict(vp8_subpix_sixtap8x8); - -#ifndef vp8_subpix_sixtap8x4 -#define vp8_subpix_sixtap8x4 vp8_sixtap_predict8x4_c -#endif -extern prototype_subpixel_predict(vp8_subpix_sixtap8x4); - -#ifndef vp8_subpix_sixtap4x4 -#define vp8_subpix_sixtap4x4 vp8_sixtap_predict_c -#endif -extern prototype_subpixel_predict(vp8_subpix_sixtap4x4); - -#ifndef vp8_subpix_bilinear16x16 -#define vp8_subpix_bilinear16x16 vp8_bilinear_predict16x16_c -#endif -extern prototype_subpixel_predict(vp8_subpix_bilinear16x16); - -#ifndef vp8_subpix_bilinear8x8 -#define vp8_subpix_bilinear8x8 vp8_bilinear_predict8x8_c -#endif -extern prototype_subpixel_predict(vp8_subpix_bilinear8x8); - -#ifndef vp8_subpix_bilinear8x4 -#define vp8_subpix_bilinear8x4 vp8_bilinear_predict8x4_c -#endif -extern prototype_subpixel_predict(vp8_subpix_bilinear8x4); - -#ifndef vp8_subpix_bilinear4x4 -#define vp8_subpix_bilinear4x4 vp8_bilinear_predict4x4_c -#endif -extern prototype_subpixel_predict(vp8_subpix_bilinear4x4); - -typedef prototype_subpixel_predict((*vp8_subpix_fn_t)); -typedef struct -{ - vp8_subpix_fn_t sixtap16x16; - vp8_subpix_fn_t sixtap8x8; - vp8_subpix_fn_t sixtap8x4; - vp8_subpix_fn_t sixtap4x4; - vp8_subpix_fn_t bilinear16x16; - vp8_subpix_fn_t bilinear8x8; - vp8_subpix_fn_t bilinear8x4; - vp8_subpix_fn_t bilinear4x4; -} vp8_subpix_rtcd_vtable_t; - -#define SUBPIX_INVOKE(ctx,fn) vp8_subpix_##fn - -#endif /* SUBPIXEL_H */ diff --git a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c index 06a0458d72..4f146ec6bd 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c @@ -14,14 +14,14 @@ #include "../common/reconintra4x4.h" #include "../common/recon.h" #include "../common/reconinter.h" -#include "dequantize.h" +#include "dequantize_dispatch.h" +#include "idct_dispatch.h" #include "detokenize.h" #include "../common/invtrans.h" #include "../common/alloccommon.h" #include "../common/entropymode.h" #include "../common/quant_common.h" #include "../common/yv12utils.h" -#include "../common/idct.h" #include "decodemv.h" #include "treereader.h" diff --git a/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c b/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c index 31f61b5dcb..7db2533a22 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c @@ -291,7 +291,8 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, vp8_mv_ref_probs(mv_ref_p, rct); mbmi->uv_mode = DC_PRED; - switch (mbmi->mode = read_mv_ref(bd, mv_ref_p)) + mbmi->mode = read_mv_ref(bd, mv_ref_p); + switch (mbmi->mode) { case SPLITMV: { @@ -392,6 +393,9 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, #if ENABLE_DEBUG default: assert(0); +#else + default: + break; #endif } } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c b/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c index d30593ed6b..90a1cd2411 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c @@ -10,10 +10,9 @@ #include "dequantize.h" -#include "../common/idct.h" -#include "../vp8_mem.h" +#include "idct.h" -void vp8_dequantize_b_c(BLOCKD *d) +void vp8_dequant_b_c(BLOCKD *d) { int i; short *DQ = d->dqcoeff; @@ -67,14 +66,14 @@ void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred, void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred, unsigned char *dest, int pitch, int stride, - int Dc) + int dc) { int i; short output[16]; short *diff_ptr = output; int r, c; - input[0] = (short)Dc; + input[0] = (short)dc; for (i = 1; i < 16; i++) { diff --git a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.h b/src/gallium/auxiliary/vl/vp8/decoder/dequantize_dispatch.h index ad961c5a0b..4cedbc142f 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.h +++ b/src/gallium/auxiliary/vl/vp8/decoder/dequantize_dispatch.h @@ -9,10 +9,8 @@ */ -#ifndef DEQUANTIZE_H -#define DEQUANTIZE_H - -#include "../common/blockd.h" +#ifndef DEQUANTIZE_DISPATCH_H +#define DEQUANTIZE_DISPATCH_H #define prototype_dequant_block(sym) \ void sym(BLOCKD *x) @@ -44,7 +42,7 @@ unsigned char *dst_v, int stride, char *eobs) #ifndef vp8_dequant_block -#define vp8_dequant_block vp8_dequantize_b_c +#define vp8_dequant_block vp8_dequant_b_c #endif extern prototype_dequant_block(vp8_dequant_block); @@ -73,17 +71,11 @@ extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block); #endif extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block); - typedef prototype_dequant_block((*vp8_dequant_block_fn_t)); - typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t)); - typedef prototype_dequant_dc_idct_add((*vp8_dequant_dc_idct_add_fn_t)); - typedef prototype_dequant_dc_idct_add_y_block((*vp8_dequant_dc_idct_add_y_block_fn_t)); - typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t)); - typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t)); typedef struct @@ -98,4 +90,4 @@ typedef struct #define DEQUANT_INVOKE(ctx,fn) vp8_dequant_##fn -#endif /* DEQUANTIZE_H */ +#endif /* DEQUANTIZE_DISPATCH_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/idctllm.c b/src/gallium/auxiliary/vl/vp8/decoder/idct.c index f155ee2e09..5dc4427263 100644 --- a/src/gallium/auxiliary/vl/vp8/common/idctllm.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/idct.c @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "idct.h" +#include "dequantize.h" /**************************************************************************** * Notes: @@ -129,7 +131,6 @@ void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, dst_ptr += stride; pred_ptr += pitch; } - } void vp8_short_inv_walsh4x4_c(short *input, short *output) @@ -197,3 +198,107 @@ void vp8_short_inv_walsh4x4_1_c(short *input, short *output) op += 4; } } + +/* ************************************************************************** */ + +void vp8_dequant_dc_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dst, int stride, + char *eobs, short *dc) +{ + int i, j; + + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) + { + if (*eobs++ > 1) + vp8_dequant_dc_idct_add_c(q, dq, pre, dst, 16, stride, dc[0]); + else + vp8_dc_only_idct_add_c(dc[0], pre, dst, 16, stride); + + q += 16; + pre += 4; + dst += 4; + dc ++; + } + + pre += 64 - 16; + dst += 4*stride - 16; + } +} + +void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dst, int stride, char *eobs) +{ + int i, j; + + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) + { + if (*eobs++ > 1) + vp8_dequant_idct_add_c(q, dq, pre, dst, 16, stride); + else + { + vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride); + ((int *)q)[0] = 0; + } + + q += 16; + pre += 4; + dst += 4; + } + + pre += 64 - 16; + dst += 4*stride - 16; + } +} + +void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dstu, unsigned char *dstv, + int stride, char *eobs) +{ + int i, j; + + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + if (*eobs++ > 1) + vp8_dequant_idct_add_c(q, dq, pre, dstu, 8, stride); + else + { + vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride); + ((int *)q)[0] = 0; + } + + q += 16; + pre += 4; + dstu += 4; + } + + pre += 32 - 8; + dstu += 4*stride - 8; + } + + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + if (*eobs++ > 1) + vp8_dequant_idct_add_c(q, dq, pre, dstv, 8, stride); + else + { + vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dstv, 8, stride); + ((int *)q)[0] = 0; + } + + q += 16; + pre += 4; + dstv += 4; + } + + pre += 32 - 8; + dstv += 4*stride - 8; + } +} diff --git a/src/gallium/auxiliary/vl/vp8/decoder/idct.h b/src/gallium/auxiliary/vl/vp8/decoder/idct.h new file mode 100644 index 0000000000..4a7b4806a6 --- /dev/null +++ b/src/gallium/auxiliary/vl/vp8/decoder/idct.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + + +#ifndef IDCT_H +#define IDCT_H + +void vp8_short_idct4x4llm_c(short *input, short *output, int pitch); + +void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch); + + +void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, + unsigned char *dst_ptr, int pitch, int stride); + +void vp8_short_inv_walsh4x4_c(short *input, short *output); + + +void vp8_short_inv_walsh4x4_1_c(short *input, short *output); + +/* ************************************************************************** */ + +void vp8_dequant_dc_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dst, int stride, + char *eobs, short *dc); + +void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dst, int stride, char *eobs); + +void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre, + unsigned char *dstu, unsigned char *dstv, + int stride, char *eobs); + + +#endif /* IDCT_H */ diff --git a/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c b/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c deleted file mode 100644 index b6b7f7b9ea..0000000000 --- a/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2010 The WebM project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "../common/idct.h" -#include "dequantize.h" - -void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred, - unsigned char *dest, int pitch, int stride, - int Dc); - -void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred, - unsigned char *dest, int pitch, int stride); - -void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, - unsigned char *dst_ptr, int pitch, int stride); - -void vp8_dequant_dc_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, - unsigned char *dst, int stride, - char *eobs, short *dc) -{ - int i, j; - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - if (*eobs++ > 1) - vp8_dequant_dc_idct_add_c(q, dq, pre, dst, 16, stride, dc[0]); - else - vp8_dc_only_idct_add_c(dc[0], pre, dst, 16, stride); - - q += 16; - pre += 4; - dst += 4; - dc ++; - } - - pre += 64 - 16; - dst += 4*stride - 16; - } -} - -void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, - unsigned char *dst, int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c(q, dq, pre, dst, 16, stride); - else - { - vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dst, 16, stride); - ((int *)q)[0] = 0; - } - - q += 16; - pre += 4; - dst += 4; - } - - pre += 64 - 16; - dst += 4*stride - 16; - } -} - -void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *pre, - unsigned char *dstu, unsigned char *dstv, - int stride, char *eobs) -{ - int i, j; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c(q, dq, pre, dstu, 8, stride); - else - { - vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dstu, 8, stride); - ((int *)q)[0] = 0; - } - - q += 16; - pre += 4; - dstu += 4; - } - - pre += 32 - 8; - dstu += 4*stride - 8; - } - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - if (*eobs++ > 1) - vp8_dequant_idct_add_c(q, dq, pre, dstv, 8, stride); - else - { - vp8_dc_only_idct_add_c(q[0]*dq[0], pre, dstv, 8, stride); - ((int *)q)[0] = 0; - } - - q += 16; - pre += 4; - dstv += 4; - } - - pre += 32 - 8; - dstv += 4*stride - 8; - } -} diff --git a/src/gallium/auxiliary/vl/vp8/common/idct.h b/src/gallium/auxiliary/vl/vp8/decoder/idct_dispatch.h index d1da0d9a73..28a5c92060 100644 --- a/src/gallium/auxiliary/vl/vp8/common/idct.h +++ b/src/gallium/auxiliary/vl/vp8/decoder/idct_dispatch.h @@ -59,8 +59,8 @@ typedef struct vp8_idct_fn_t idct16; vp8_idct_scalar_add_fn_t idct1_scalar_add; - vp8_second_order_fn_t iwalsh1; - vp8_second_order_fn_t iwalsh16; + vp8_second_order_fn_t iwalsh1; + vp8_second_order_fn_t iwalsh16; } vp8_idct_rtcd_vtable_t; #define IDCT_INVOKE(ctx,fn) vp8_idct_##fn |