summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-11-26 16:46:13 -0800
committerDmitry Kovalev <dkovalev@google.com>2013-11-26 16:46:13 -0800
commitc5bdc9dfd27e5aa91cdabc67c5912d70baadc2ab (patch)
tree985f0e7ff1c3411718bcd02e310f2dfeb3e974dc /vp9
parentb60293e1ce9bc1b392e9e6652f17bb44bf9699b2 (diff)
downloadlibvpx-c5bdc9dfd27e5aa91cdabc67c5912d70baadc2ab.tar
libvpx-c5bdc9dfd27e5aa91cdabc67c5912d70baadc2ab.tar.gz
libvpx-c5bdc9dfd27e5aa91cdabc67c5912d70baadc2ab.tar.bz2
libvpx-c5bdc9dfd27e5aa91cdabc67c5912d70baadc2ab.zip
Making names consistent with REFERENCE_MODE enum name.
Change-Id: I17268af3e0cbf7e5788c3154466e404947c944b3
Diffstat (limited to 'vp9')
-rw-r--r--vp9/decoder/vp9_decodeframe.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index 097ffb1da..9c9490592 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -51,7 +51,7 @@ static int read_be32(const uint8_t *p) {
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}
-static int is_compound_prediction_allowed(const VP9_COMMON *cm) {
+static int is_compound_reference_allowed(const VP9_COMMON *cm) {
int i;
for (i = 1; i < ALLOWED_REFS_PER_FRAME; ++i)
if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1])
@@ -60,7 +60,7 @@ static int is_compound_prediction_allowed(const VP9_COMMON *cm) {
return 0;
}
-static void setup_compound_prediction(VP9_COMMON *cm) {
+static void setup_compound_reference(VP9_COMMON *cm) {
if (cm->ref_frame_sign_bias[LAST_FRAME] ==
cm->ref_frame_sign_bias[GOLDEN_FRAME]) {
cm->comp_fixed_ref = ALTREF_FRAME;
@@ -95,7 +95,7 @@ static TX_MODE read_tx_mode(vp9_reader *r) {
return tx_mode;
}
-static void read_tx_probs(struct tx_probs *tx_probs, vp9_reader *r) {
+static void read_tx_mode_probs(struct tx_probs *tx_probs, vp9_reader *r) {
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
@@ -125,22 +125,20 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
vp9_diff_update_prob(r, &fc->inter_mode_probs[i][j]);
}
-static INLINE REFERENCE_MODE read_comp_pred_mode(vp9_reader *r) {
- REFERENCE_MODE mode = vp9_read_bit(r);
- if (mode)
- mode += vp9_read_bit(r);
- return mode;
+static REFERENCE_MODE read_reference_mode(VP9_COMMON *cm, vp9_reader *r) {
+ if (is_compound_reference_allowed(cm)) {
+ REFERENCE_MODE mode = vp9_read_bit(r);
+ if (mode)
+ mode += vp9_read_bit(r);
+ setup_compound_reference(cm);
+ return mode;
+ } else {
+ return SINGLE_REFERENCE;
+ }
}
-static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
+static void read_reference_mode_probs(VP9_COMMON *cm, vp9_reader *r) {
int i;
-
- const int compound_allowed = is_compound_prediction_allowed(cm);
- cm->comp_pred_mode = compound_allowed ? read_comp_pred_mode(r)
- : SINGLE_REFERENCE;
- if (compound_allowed)
- setup_compound_prediction(cm);
-
if (cm->comp_pred_mode == REFERENCE_MODE_SELECT)
for (i = 0; i < COMP_INTER_CONTEXTS; i++)
vp9_diff_update_prob(r, &cm->fc.comp_inter_prob[i]);
@@ -1217,7 +1215,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
cm->tx_mode = xd->lossless ? ONLY_4X4 : read_tx_mode(&r);
if (cm->tx_mode == TX_MODE_SELECT)
- read_tx_probs(&fc->tx_probs, &r);
+ read_tx_mode_probs(&fc->tx_probs, &r);
read_coef_probs(fc, cm->tx_mode, &r);
for (k = 0; k < MBSKIP_CONTEXTS; ++k)
@@ -1235,7 +1233,8 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
vp9_diff_update_prob(&r, &fc->intra_inter_prob[i]);
- read_comp_pred(cm, &r);
+ cm->comp_pred_mode = read_reference_mode(cm, &r);
+ read_reference_mode_probs(cm, &r);
for (j = 0; j < BLOCK_SIZE_GROUPS; j++)
for (i = 0; i < INTRA_MODES - 1; ++i)