190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber/*
2f71323e297a928af368937089d3ed71239786f86Andreas Huber *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber *
4f71323e297a928af368937089d3ed71239786f86Andreas Huber *  Use of this source code is governed by a BSD-style license
5f71323e297a928af368937089d3ed71239786f86Andreas Huber *  that can be found in the LICENSE file in the root of the source
6f71323e297a928af368937089d3ed71239786f86Andreas Huber *  tree. An additional intellectual property rights grant can be found
7f71323e297a928af368937089d3ed71239786f86Andreas Huber *  in the file PATENTS.  All contributing project authors may
8f71323e297a928af368937089d3ed71239786f86Andreas Huber *  be found in the AUTHORS file in the root of the source tree.
990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber */
1090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
1190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
1290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "g_common.h"
1390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "subpixel.h"
1490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "loopfilter.h"
1590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "recon.h"
1690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "idct.h"
1790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber#include "onyxc_int.h"
1890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
1990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid (*vp8_short_idct4x4)(short *input, short *output, int pitch);
2090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid (*vp8_short_idct4x4_1)(short *input, short *output, int pitch);
2190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid (*vp8_dc_only_idct)(short input_dc, short *output, int pitch);
2290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
2390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void (*vp8_post_proc_down_and_across)(
2490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    unsigned char *src_ptr,
2590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    unsigned char *dst_ptr,
2690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int src_pixels_per_line,
2790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int dst_pixels_per_line,
2890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int rows,
2990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int cols,
3090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int flimit
3190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber);
3290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
3390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void (*vp8_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit);
3490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit);
3590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void (*vp8_mbpost_proc_across_ip)(unsigned char *src, int pitch, int rows, int cols, int flimit);
3690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit);
3790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
3890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_post_proc_down_and_across_c
3990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber(
4090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    unsigned char *src_ptr,
4190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    unsigned char *dst_ptr,
4290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int src_pixels_per_line,
4390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int dst_pixels_per_line,
4490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int rows,
4590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int cols,
4690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    int flimit
4790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber);
4890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a);
4990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
5090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function *vp8_copy_mem16x16;
5190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function *vp8_copy_mem8x8;
5290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function *vp8_copy_mem8x4;
5390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
5490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber// PPC
5590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function sixtap_predict_ppc;
5690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function sixtap_predict8x4_ppc;
5790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function sixtap_predict8x8_ppc;
5890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function sixtap_predict16x16_ppc;
5990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function bilinear_predict4x4_ppc;
6090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function bilinear_predict8x4_ppc;
6190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function bilinear_predict8x8_ppc;
6290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function bilinear_predict16x16_ppc;
6390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
6490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function copy_mem16x16_ppc;
6590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
6690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid recon_b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
6790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid recon2b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
6890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid recon4b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
6990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
7090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void short_idct4x4llm_ppc(short *input, short *output, int pitch);
7190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
7290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber// Generic C
7390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_sixtap_predict_c;
7490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_sixtap_predict8x4_c;
7590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_sixtap_predict8x8_c;
7690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_sixtap_predict16x16_c;
7790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_bilinear_predict4x4_c;
7890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_bilinear_predict8x4_c;
7990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_bilinear_predict8x8_c;
8090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern subpixel_predict_function vp8_bilinear_predict16x16_c;
8190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
8290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function vp8_copy_mem16x16_c;
8390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function vp8_copy_mem8x8_c;
8490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern copy_mem_block_function vp8_copy_mem8x4_c;
8590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
8690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_recon_b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
8790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_recon2b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
8890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_recon4b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
8990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
9090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch);
9190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_short_idct4x4llm_c(short *input, short *output, int pitch);
9290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern void vp8_dc_only_idct_c(short input_dc, short *output, int pitch);
9390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
9490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber// PPC
9590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_mbv_ppc;
9690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_bv_ppc;
9790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_mbh_ppc;
9890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_bh_ppc;
9990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
10090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_mbvs_ppc;
10190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_bvs_ppc;
10290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_mbhs_ppc;
10390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function loop_filter_bhs_ppc;
10490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
10590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber// Generic C
10690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_mbv_c;
10790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_bv_c;
10890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_mbh_c;
10990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_bh_c;
11090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
11190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_mbvs_c;
11290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_bvs_c;
11390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_mbhs_c;
11490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function vp8_loop_filter_bhs_c;
11590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
11690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_mbvfull;
11790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_mbhfull;
11890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_bvfull;
11990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_bhfull;
12090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
12190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_mbvsimple;
12290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_mbhsimple;
12390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_bvsimple;
12490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huberextern loop_filter_block_function *vp8_lf_bhsimple;
12590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
12690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_clear_c(void)
12790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber{
12890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber}
12990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
13090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Hubervoid vp8_machine_specific_config(void)
13190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber{
13290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    // Pure C:
13390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_clear_system_state                = vp8_clear_c;
13490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_recon_b                          = vp8_recon_b_c;
13590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_recon4b                         = vp8_recon4b_c;
13690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_recon2b                         = vp8_recon2b_c;
13790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
13890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_bilinear_predict16x16            = bilinear_predict16x16_ppc;
13990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_bilinear_predict8x8              = bilinear_predict8x8_ppc;
14090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_bilinear_predict8x4              = bilinear_predict8x4_ppc;
14190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_bilinear_predict                 = bilinear_predict4x4_ppc;
14290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
14390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_sixtap_predict16x16              = sixtap_predict16x16_ppc;
14490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_sixtap_predict8x8                = sixtap_predict8x8_ppc;
14590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_sixtap_predict8x4                = sixtap_predict8x4_ppc;
14690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_sixtap_predict                   = sixtap_predict_ppc;
14790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
14890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_short_idct4x4_1                  = vp8_short_idct4x4llm_1_c;
14990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_short_idct4x4                    = short_idct4x4llm_ppc;
15090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_dc_only_idct                      = vp8_dc_only_idct_c;
15190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
15290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_mbvfull                       = loop_filter_mbv_ppc;
15390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_bvfull                        = loop_filter_bv_ppc;
15490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_mbhfull                       = loop_filter_mbh_ppc;
15590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_bhfull                        = loop_filter_bh_ppc;
15690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
15790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_mbvsimple                     = loop_filter_mbvs_ppc;
15890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_bvsimple                      = loop_filter_bvs_ppc;
15990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_mbhsimple                     = loop_filter_mbhs_ppc;
16090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_lf_bhsimple                      = loop_filter_bhs_ppc;
16190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
16290d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_post_proc_down_and_across           = vp8_post_proc_down_and_across_c;
16390d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_mbpost_proc_down                  = vp8_mbpost_proc_down_c;
16490d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_mbpost_proc_across_ip              = vp8_mbpost_proc_across_ip_c;
16590d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_plane_add_noise                   = vp8_plane_add_noise_c;
16690d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
16790d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_copy_mem16x16                    = copy_mem16x16_ppc;
16890d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_copy_mem8x8                      = vp8_copy_mem8x8_c;
16990d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber    vp8_copy_mem8x4                      = vp8_copy_mem8x4_c;
17090d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber
17190d3ed91ae9228e1c8bab561b6138d4cb8c1e4fdAndreas Huber}
172