[x264-devel] commit: Add subpartition cost for sub-8x8 blocks (Jason Garrett-Glaser )

git version control git at videolan.org
Fri Jun 26 07:14:04 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Wed Jun 24 14:39:15 2009 -0700| [f6d31669a2547110b9c1323aa51437296f2f3506] | committer: Jason Garrett-Glaser 

Add subpartition cost for sub-8x8 blocks
Improves sub-p8x8 mode decision.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=f6d31669a2547110b9c1323aa51437296f2f3506
---

 encoder/cabac.c |    4 +++-
 encoder/cavlc.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/encoder/cabac.c b/encoder/cabac.c
index 61a0e9b..ce4175a 100644
--- a/encoder/cabac.c
+++ b/encoder/cabac.c
@@ -986,7 +986,8 @@ void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
 /*****************************************************************************
  * RD only; doesn't generate a valid bitstream
  * doesn't write cbp or chroma dc (I don't know how much this matters)
- * doesn't write ref or subpartition (never varies between calls, so no point in doing so)
+ * doesn't write ref (never varies between calls, so no point in doing so)
+ * only writes subpartition for p8x8, needed for sub-8x8 mode decision RDO
  * works on all partition sizes except 16x16
  *****************************************************************************/
 static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int i_pixel )
@@ -998,6 +999,7 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
     if( i_mb_type == P_8x8 )
     {
         x264_cabac_mb8x8_mvd( h, cb, i8 );
+        x264_cabac_mb_sub_p_partition( cb, h->mb.i_sub_partition[i8] );
     }
     else if( i_mb_type == P_L0 )
         x264_cabac_mb_mvd( h, cb, 0, 4*i8, 4>>b_8x16, 2<<b_8x16 );
diff --git a/encoder/cavlc.c b/encoder/cavlc.c
index ca57e8b..cbe85b0 100644
--- a/encoder/cavlc.c
+++ b/encoder/cavlc.c
@@ -552,7 +552,8 @@ void x264_macroblock_write_cavlc( x264_t *h, bs_t *s )
 /*****************************************************************************
  * RD only; doesn't generate a valid bitstream
  * doesn't write cbp or chroma dc (I don't know how much this matters)
- * doesn't write ref or subpartition (never varies between calls, so no point in doing so)
+ * doesn't write ref (never varies between calls, so no point in doing so)
+ * only writes subpartition for p8x8, needed for sub-8x8 mode decision RDO
  * works on all partition sizes except 16x16
  *****************************************************************************/
 static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
@@ -565,6 +566,7 @@ static int x264_partition_size_cavlc( x264_t *h, int i8, int i_pixel )
     if( i_mb_type == P_8x8 )
     {
         cavlc_mb8x8_mvd( h, &h->out.bs, i8 );
+        bs_write_ue( &h->out.bs, sub_mb_type_p_to_golomb[ h->mb.i_sub_partition[i8] ] );
     }
     else if( i_mb_type == P_L0 )
         cavlc_mb_mvd( h, &h->out.bs, 0, 4*i8, 4>>b_8x16 );



More information about the x264-devel mailing list