]> git.sesse.net Git - x264/blobdiff - common/pixel.h
Add support for the new (4:4:4) colorspaces to x264_picture_alloc
[x264] / common / pixel.h
index 54bb8d7d42185c23fc4a82b1b1003d0ca26f3734..862b1424a2b596c830b0f43986dd9b1b622d3c69 100644 (file)
@@ -1,7 +1,10 @@
 /*****************************************************************************
- * pixel.h: h264 encoder library
+ * pixel.c: pixel metrics
  *****************************************************************************
- * Copyright (C) 2004-2008 Loren Merritt <lorenm@u.washington.edu>
+ * Copyright (C) 2004-2011 x264 project
+ *
+ * Authors: Loren Merritt <lorenm@u.washington.edu>
+ *          Fiona Glaser <fiona@x264.com>
  *
  * 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
@@ -16,6 +19,9 @@
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
+ *
+ * This program is also available under a commercial proprietary license.
+ * For more information, contact us at licensing@x264.com.
  *****************************************************************************/
 
 #ifndef X264_PIXEL_H
@@ -41,10 +47,12 @@ enum
     PIXEL_2x2   = 9,
 };
 
-static const struct {
+static const struct
+{
     int w;
     int h;
-} x264_pixel_size[7] = {
+} x264_pixel_size[7] =
+{
     { 16, 16 },
     { 16,  8 }, {  8, 16 },
     {  8,  8 },
@@ -52,7 +60,8 @@ static const struct {
     {  4,  4 }
 };
 
-static const uint8_t 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 },
@@ -73,13 +82,15 @@ typedef struct
     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 (*vsad)( pixel *, int, int );
     int (*var2_8x8)( pixel *, int, pixel *, int, int * );
 
     uint64_t (*var[4])( pixel *pix, int stride );
     uint64_t (*hadamard_ac[4])( pixel *pix, int stride );
 
-    uint64_t (*ssd_nv12_core)( pixel *pixuv1, int stride1,
-                               pixel *pixuv2, int stride2, int width, int height );
+    void (*ssd_nv12_core)( pixel *pixuv1, int stride1,
+                           pixel *pixuv2, int stride2, int width, int height,
+                           uint64_t *ssd_u, uint64_t *ssd_v );
     void (*ssim_4x4x2_core)( const pixel *pix1, int stride1,
                              const pixel *pix2, int stride2, int sums[2][4] );
     float (*ssim_end4)( int sum0[5][4], int sum1[5][4], int width );
@@ -112,8 +123,9 @@ typedef struct
 } x264_pixel_function_t;
 
 void x264_pixel_init( int cpu, x264_pixel_function_t *pixf );
-uint64_t x264_pixel_ssd_nv12( x264_pixel_function_t *pf, pixel *pix1, int i_pix1, pixel *pix2, int i_pix2, int i_width, int i_height );
+void x264_pixel_ssd_nv12( x264_pixel_function_t *pf, pixel *pix1, int i_pix1, pixel *pix2, int i_pix2, int i_width, int i_height, uint64_t *ssd_u, uint64_t *ssd_v );
 uint64_t x264_pixel_ssd_wxh( x264_pixel_function_t *pf, pixel *pix1, int i_pix1, pixel *pix2, int i_pix2, int i_width, int i_height );
-float x264_pixel_ssim_wxh( x264_pixel_function_t *pf, pixel *pix1, int i_pix1, pixel *pix2, int i_pix2, int i_width, int i_height, void *buf );
+float x264_pixel_ssim_wxh( x264_pixel_function_t *pf, pixel *pix1, int i_pix1, pixel *pix2, int i_pix2, int i_width, int i_height, void *buf, int *cnt );
+int x264_field_vsad( x264_t *h, int mb_x, int mb_y );
 
 #endif