]> git.sesse.net Git - x264/commitdiff
Add full-recon API option
authorFiona Glaser <fiona@x264.com>
Fri, 24 Feb 2012 21:16:52 +0000 (13:16 -0800)
committerFiona Glaser <fiona@x264.com>
Wed, 7 Mar 2012 01:13:26 +0000 (17:13 -0800)
Fully reconstruct frames even without dump-yuv.

encoder/encoder.c
x264.h

index 93842ef98d069fc5dc57578ebc4ccccdb5b5561e..85260d225fda33c38c5728ec4ccc53969effa756 100644 (file)
@@ -921,6 +921,9 @@ static int x264_validate_parameters( x264_t *h, int b_open )
         h->param.i_nal_hrd = X264_NAL_HRD_VBR;
     }
 
+    if( h->param.psz_dump_yuv )
+        h->param.b_full_recon = 1;
+
     /* ensure the booleans are 0 or 1 so they can be used in math */
 #define BOOLIFY(x) h->param.x = !!h->param.x
     BOOLIFY( b_cabac );
@@ -941,6 +944,7 @@ static int x264_validate_parameters( x264_t *h, int b_open )
     BOOLIFY( b_fake_interlaced );
     BOOLIFY( b_open_gop );
     BOOLIFY( b_bluray_compat );
+    BOOLIFY( b_full_recon );
     BOOLIFY( analyse.b_transform_8x8 );
     BOOLIFY( analyse.b_weighted_bipred );
     BOOLIFY( analyse.b_chroma_me );
@@ -1839,7 +1843,7 @@ static void x264_fdec_filter_row( x264_t *h, int mb_y, int b_inloop )
      * above each MB, as bS=4 doesn't happen for the top of interlaced mbpairs. */
     int minpix_y = min_y*16 - 4 * !b_start;
     int maxpix_y = mb_y*16 - 4 * !b_end;
-    b_deblock &= b_hpel || h->param.psz_dump_yuv;
+    b_deblock &= b_hpel || h->param.b_full_recon;
     if( h->param.b_sliced_threads && b_start && min_y && !b_inloop )
     {
         b_deblock = 0;         /* We already deblocked on the inloop pass. */
@@ -2144,7 +2148,7 @@ static int x264_slice_write( x264_t *h )
     int orig_last_mb = h->sh.i_last_mb;
     uint8_t *last_emu_check;
     x264_bs_bak_t bs_bak[2];
-    b_deblock &= b_hpel || h->param.psz_dump_yuv;
+    b_deblock &= b_hpel || h->param.b_full_recon;
     bs_realign( &h->out.bs );
 
     /* Slice */
diff --git a/x264.h b/x264.h
index b5e38d43f55bb6f672114292379070cda139fd06..dd309ef442736e79e4e37c7de1d61b85522a7996 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -41,7 +41,7 @@
 
 #include "x264_config.h"
 
-#define X264_BUILD 121
+#define X264_BUILD 122
 
 /* x264_t:
  *      opaque handler for encoder */
@@ -323,6 +323,7 @@ typedef struct x264_param_t
     void        *p_log_private;
     int         i_log_level;
     int         b_visualize;
+    int         b_full_recon;   /* fully reconstruct frames, even when not necessary for encoding.  Implied by psz_dump_yuv */
     char        *psz_dump_yuv;  /* filename for reconstructed frames */
 
     /* Encoder analyser parameters */
@@ -727,7 +728,10 @@ typedef struct
            of H.264 itself; in this case, the caller must force an IDR frame
            if it needs the changed parameter to apply immediately. */
     x264_param_t *param;
-    /* In: raw data */
+    /* In: raw image data */
+    /* Out: reconstructed image data.  x264 may skip part of the reconstruction process,
+            e.g. deblocking, in frames where it isn't necessary.  To force complete
+            reconstruction, at a small speed cost, set b_full_recon. */
     x264_image_t img;
     /* In: optional information to modify encoder decisions for this frame
      * Out: information about the encoded frame */