/* * 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 <assert.h> #include "./vp8_rtcd.h" #include "vp8/common/filter.h" DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]) = …; DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]) = …; static void filter_block2d_first_pass(unsigned char *src_ptr, int *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, const short *vp8_filter) { … } static void filter_block2d_second_pass(int *src_ptr, unsigned char *output_ptr, int output_pitch, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned int output_height, unsigned int output_width, const short *vp8_filter) { … } static void filter_block2d(unsigned char *src_ptr, unsigned char *output_ptr, unsigned int src_pixels_per_line, int output_pitch, const short *HFilter, const short *VFilter) { … } void vp8_sixtap_predict4x4_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_sixtap_predict8x8_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_sixtap_predict8x4_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_sixtap_predict16x16_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } /**************************************************************************** * * ROUTINE : filter_block2d_bil_first_pass * * INPUTS : UINT8 *src_ptr : Pointer to source block. * UINT32 src_stride : Stride of source block. * UINT32 height : Block height. * UINT32 width : Block width. * INT32 *vp8_filter : Array of 2 bi-linear filter taps. * * OUTPUTS : INT32 *dst_ptr : Pointer to filtered block. * * RETURNS : void * * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block * in the horizontal direction to produce the filtered output * block. Used to implement first-pass of 2-D separable filter. * * SPECIAL NOTES : Produces INT32 output to retain precision for next pass. * Two filter taps should sum to VP8_FILTER_WEIGHT. * ****************************************************************************/ static void filter_block2d_bil_first_pass( unsigned char *src_ptr, unsigned short *dst_ptr, unsigned int src_stride, unsigned int height, unsigned int width, const short *vp8_filter) { … } /**************************************************************************** * * ROUTINE : filter_block2d_bil_second_pass * * INPUTS : INT32 *src_ptr : Pointer to source block. * UINT32 dst_pitch : Destination block pitch. * UINT32 height : Block height. * UINT32 width : Block width. * INT32 *vp8_filter : Array of 2 bi-linear filter taps. * * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block. * * RETURNS : void * * FUNCTION : Applies a 1-D 2-tap bi-linear filter to the source block * in the vertical direction to produce the filtered output * block. Used to implement second-pass of 2-D separable * filter. * * SPECIAL NOTES : Requires 32-bit input as produced by * filter_block2d_bil_first_pass. * Two filter taps should sum to VP8_FILTER_WEIGHT. * ****************************************************************************/ static void filter_block2d_bil_second_pass(unsigned short *src_ptr, unsigned char *dst_ptr, int dst_pitch, unsigned int height, unsigned int width, const short *vp8_filter) { … } /**************************************************************************** * * ROUTINE : filter_block2d_bil * * INPUTS : UINT8 *src_ptr : Pointer to source block. * UINT32 src_pitch : Stride of source block. * UINT32 dst_pitch : Stride of destination block. * INT32 *HFilter : Array of 2 horizontal filter * taps. * INT32 *VFilter : Array of 2 vertical filter taps. * INT32 Width : Block width * INT32 Height : Block height * * OUTPUTS : UINT16 *dst_ptr : Pointer to filtered block. * * RETURNS : void * * FUNCTION : 2-D filters an input block by applying a 2-tap * bi-linear filter horizontally followed by a 2-tap * bi-linear filter vertically on the result. * * SPECIAL NOTES : The largest block size can be handled here is 16x16 * ****************************************************************************/ static void filter_block2d_bil(unsigned char *src_ptr, unsigned char *dst_ptr, unsigned int src_pitch, unsigned int dst_pitch, const short *HFilter, const short *VFilter, int Width, int Height) { … } void vp8_bilinear_predict4x4_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_bilinear_predict8x8_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_bilinear_predict8x4_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … } void vp8_bilinear_predict16x16_c(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch) { … }