]> git.videolan.org Git - x264.git/commitdiff
Disable I_PCM with psy-RD
authorJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 20 Sep 2008 08:39:16 +0000 (01:39 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 20 Sep 2008 08:42:29 +0000 (01:42 -0700)
psy-RD seems to put the PCM threshold a bit lower than it should be, so PCM is now disabled under psy-RD.

encoder/analyse.c

index 5b713b57446c6f2a014d10e6064e35fb032fd37b..a67010eef2c5fe3346fb9b2ef9a7bb95b9dfe976 100644 (file)
@@ -225,8 +225,8 @@ static void x264_mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int i_qp )
     a->i_satd_i4x4   =
     a->i_satd_i8x8chroma = COST_MAX;
 
-    /* non-RD PCM decision is inaccurate, so don't do it */
-    a->i_satd_pcm = a->b_mbrd ? ((uint64_t)X264_PCM_COST*a->i_lambda2 + 128) >> 8 : COST_MAX;
+    /* non-RD PCM decision is inaccurate (as is psy-rd), so don't do it */
+    a->i_satd_pcm = !h->mb.i_psy_rd && a->b_mbrd ? ((uint64_t)X264_PCM_COST*a->i_lambda2 + 128) >> 8 : COST_MAX;
 
     a->b_fast_intra = 0;
     h->mb.i_skip_intra =