shithub: libvpx

Download patch

ref: 5f4722c75f3b0d19c97ec652b38ca4e93a092970
parent: 6638b6f63fe5a45a6b1a3dc05c338fe2e60050a8
parent: 30d2ea45ce12a937e6ed015b5576a9fe8e47c945
author: Paul Wilkins <[email protected]>
date: Tue Jul 16 22:50:09 EDT 2013

Merge "Minor cleanup in code to fine uv tx_size."

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -389,9 +389,7 @@
 
 
 static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi) {
-  const TX_SIZE size = mbmi->txfm_size;
-  const TX_SIZE max_size = max_uv_txsize_lookup[mbmi->sb_type];
-  return (size > max_size ? max_size : size);
+  return MIN(mbmi->txfm_size, max_uv_txsize_lookup[mbmi->sb_type]);
 }
 
 struct plane_block_idx {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3330,13 +3330,7 @@
       if (rate_y == INT_MAX)
         continue;
 
-      uv_tx = mbmi->txfm_size;
-      if (bsize < BLOCK_SIZE_MB16X16 && uv_tx == TX_8X8)
-        uv_tx = TX_4X4;
-      if (bsize < BLOCK_SIZE_SB32X32 && uv_tx == TX_16X16)
-        uv_tx = TX_8X8;
-      else if (bsize < BLOCK_SIZE_SB64X64 && uv_tx == TX_32X32)
-        uv_tx = TX_16X16;
+      uv_tx = MIN(mbmi->txfm_size, max_uv_txsize_lookup[bsize]);
 
       rate_uv = rate_uv_intra[uv_tx];
       distortion_uv = dist_uv[uv_tx];