Commit 69d21011 authored by Jingning Han's avatar Jingning Han
Browse files

Use single reference frame for 4x4 coding block in chroma-sub8x8

Change-Id: Ic04bd1ac62ea35082883d0560f91843040e35a64
parent 36bad477
...@@ -38,7 +38,11 @@ ...@@ -38,7 +38,11 @@
extern "C" { extern "C" {
#endif #endif
#define SUB8X8_COMP_REF (!(CONFIG_CB4X4 && CONFIG_CHROMA_2X2)) #if (CONFIG_CHROMA_SUB8X8 || CONFIG_CHROMA_2X2)
#define SUB8X8_COMP_REF 0
#else
#define SUB8X8_COMP_REF 1
#endif
#define MAX_MB_PLANE 3 #define MAX_MB_PLANE 3
......
...@@ -1301,7 +1301,7 @@ static REFERENCE_MODE read_block_reference_mode(AV1_COMMON *cm, ...@@ -1301,7 +1301,7 @@ static REFERENCE_MODE read_block_reference_mode(AV1_COMMON *cm,
const MACROBLOCKD *xd, const MACROBLOCKD *xd,
aom_reader *r) { aom_reader *r) {
#if !SUB8X8_COMP_REF #if !SUB8X8_COMP_REF
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) return SINGLE_REFERENCE; if (xd->mi[0]->mbmi.sb_type == BLOCK_4X4) return SINGLE_REFERENCE;
#endif #endif
if (cm->reference_mode == REFERENCE_MODE_SELECT) { if (cm->reference_mode == REFERENCE_MODE_SELECT) {
const int ctx = av1_get_reference_mode_context(cm, xd); const int ctx = av1_get_reference_mode_context(cm, xd);
......
...@@ -1221,7 +1221,7 @@ static void write_ref_frames(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -1221,7 +1221,7 @@ static void write_ref_frames(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if SUB8X8_COMP_REF #if SUB8X8_COMP_REF
aom_write(w, is_compound, av1_get_reference_mode_prob(cm, xd)); aom_write(w, is_compound, av1_get_reference_mode_prob(cm, xd));
#else #else
if (mbmi->sb_type >= BLOCK_8X8) if (mbmi->sb_type != BLOCK_4X4)
aom_write(w, is_compound, av1_get_reference_mode_prob(cm, xd)); aom_write(w, is_compound, av1_get_reference_mode_prob(cm, xd));
#endif #endif
} else { } else {
......
...@@ -2115,7 +2115,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row, ...@@ -2115,7 +2115,7 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
if (cm->reference_mode == REFERENCE_MODE_SELECT) { if (cm->reference_mode == REFERENCE_MODE_SELECT) {
#if !SUB8X8_COMP_REF #if !SUB8X8_COMP_REF
if (mbmi->sb_type >= BLOCK_8X8) if (mbmi->sb_type != BLOCK_4X4)
counts->comp_inter[av1_get_reference_mode_context(cm, xd)] counts->comp_inter[av1_get_reference_mode_context(cm, xd)]
[has_second_ref(mbmi)]++; [has_second_ref(mbmi)]++;
#else #else
......
...@@ -10338,7 +10338,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data, ...@@ -10338,7 +10338,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
int_mv backup_ref_mv[2]; int_mv backup_ref_mv[2];
#if !SUB8X8_COMP_REF #if !SUB8X8_COMP_REF
if (bsize < BLOCK_8X8 && mbmi->ref_frame[1] > INTRA_FRAME) continue; if (bsize == BLOCK_4X4 && mbmi->ref_frame[1] > INTRA_FRAME) continue;
#endif // !SUB8X8_COMP_REF #endif // !SUB8X8_COMP_REF
backup_ref_mv[0] = mbmi_ext->ref_mvs[ref_frame][0]; backup_ref_mv[0] = mbmi_ext->ref_mvs[ref_frame][0];
...@@ -10683,7 +10683,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data, ...@@ -10683,7 +10683,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
#if SUB8X8_COMP_REF #if SUB8X8_COMP_REF
compmode_cost = av1_cost_bit(comp_mode_p, comp_pred); compmode_cost = av1_cost_bit(comp_mode_p, comp_pred);
#else #else
if (mbmi->sb_type >= BLOCK_8X8) if (mbmi->sb_type != BLOCK_4X4)
compmode_cost = av1_cost_bit(comp_mode_p, comp_pred); compmode_cost = av1_cost_bit(comp_mode_p, comp_pred);
#endif // SUB8X8_COMP_REF #endif // SUB8X8_COMP_REF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment