X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=common%2Fpixel.h;h=4e157ef62ce6b727c814498fe2129a33cd2bbc55;hb=19ebada1c9a67ac0837936eb9269224cb3ce8dd7;hp=9366b697c046bcbb65a4953d6f085b4b0cfba632;hpb=2cd3c7b140e7bc60d902e4e7a049c17e82c02f6e;p=x264 diff --git a/common/pixel.h b/common/pixel.h index 9366b697..4e157ef6 100644 --- a/common/pixel.h +++ b/common/pixel.h @@ -1,10 +1,7 @@ /***************************************************************************** * pixel.h: h264 encoder library ***************************************************************************** - * Copyright (C) 2003 Laurent Aimar - * $Id: pixel.h,v 1.1 2004/06/03 19:27:07 fenrir Exp $ - * - * Authors: Laurent Aimar + * Copyright (C) 2004-2008 Loren Merritt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,12 +15,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. *****************************************************************************/ -#ifndef _PIXEL_H -#define _PIXEL_H 1 +#ifndef X264_PIXEL_H +#define X264_PIXEL_H +// SSD assumes all args aligned +// other cmp functions assume first arg aligned typedef int (*x264_pixel_cmp_t) ( uint8_t *, int, uint8_t *, int ); typedef void (*x264_pixel_cmp_x3_t) ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int[3] ); typedef void (*x264_pixel_cmp_x4_t) ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int[4] ); @@ -53,7 +52,7 @@ static const struct { { 4, 4 } }; -static const int x264_size2pixel[5][5] = { +static const uint8_t x264_size2pixel[5][5] = { { 0, }, { 0, PIXEL_4x4, PIXEL_8x4, 0, 0 }, { 0, PIXEL_4x8, PIXEL_8x8, 0, PIXEL_16x8 }, @@ -69,27 +68,38 @@ typedef struct x264_pixel_cmp_t ssim[7]; x264_pixel_cmp_t sa8d[4]; x264_pixel_cmp_t mbcmp[7]; /* either satd or sad for subpel refine and mode decision */ - x264_pixel_cmp_t rdcmp[7]; /* either ssd or ssim for rate-distortion */ + x264_pixel_cmp_t mbcmp_unaligned[7]; /* unaligned mbcmp for subpel */ + x264_pixel_cmp_t fpelcmp[7]; /* either satd or sad for fullpel motion search */ + x264_pixel_cmp_x3_t fpelcmp_x3[7]; + x264_pixel_cmp_x4_t fpelcmp_x4[7]; + x264_pixel_cmp_t sad_aligned[7]; /* Aligned SAD for mbcmp */ + + int (*var[4])( uint8_t *pix, int stride, uint32_t *sad ); + uint64_t (*hadamard_ac[4])( uint8_t *pix, int stride ); void (*ssim_4x4x2_core)( const uint8_t *pix1, int stride1, const uint8_t *pix2, int stride2, int sums[2][4] ); float (*ssim_end4)( int sum0[5][4], int sum1[5][4], int width ); - /* multiple parallel calls to sad. */ + /* multiple parallel calls to cmp. */ x264_pixel_cmp_x3_t sad_x3[7]; x264_pixel_cmp_x4_t sad_x4[7]; + x264_pixel_cmp_x3_t satd_x3[7]; + x264_pixel_cmp_x4_t satd_x4[7]; /* abs-diff-sum for successive elimination. - * may round width up to a multiple of 8. */ - void (*ads[7])( int enc_dc[4], uint16_t *sums, int delta, - uint16_t *res, int width ); + * may round width up to a multiple of 16. */ + int (*ads[7])( int enc_dc[4], uint16_t *sums, int delta, + uint16_t *cost_mvx, int16_t *mvs, int width, int thresh ); - /* calculate satd of V, H, and DC modes. + /* calculate satd or sad of V, H, and DC modes. * may be NULL, in which case just use pred+satd instead. */ - void (*intra_satd_x3_16x16)( uint8_t *fenc, uint8_t *fdec, int res[3] ); - void (*intra_satd_x3_8x8c)( uint8_t *fenc, uint8_t *fdec, int res[3] ); - void (*intra_satd_x3_4x4)( uint8_t *fenc, uint8_t *fdec, int res[3] ); - void (*intra_sa8d_x3_8x8)( uint8_t *fenc, uint8_t edge[33], int res[3] ); + void (*intra_mbcmp_x3_16x16)( uint8_t *fenc, uint8_t *fdec , int res[3] ); + void (*intra_satd_x3_16x16) ( uint8_t *fenc, uint8_t *fdec , int res[3] ); + void (*intra_sad_x3_16x16) ( uint8_t *fenc, uint8_t *fdec , int res[3] ); + void (*intra_satd_x3_8x8c) ( uint8_t *fenc, uint8_t *fdec , int res[3] ); + void (*intra_satd_x3_4x4) ( uint8_t *fenc, uint8_t *fdec , int res[3] ); + void (*intra_sa8d_x3_8x8) ( uint8_t *fenc, uint8_t edge[33], int res[3] ); } x264_pixel_function_t; void x264_pixel_init( int cpu, x264_pixel_function_t *pixf );