Port renaming changes from AOMedia
Cherry-Picked the following commits:
0defd8f Changed "WebM" to "AOMedia" & "webm" to "aomedia"
54e6676 Replace "VPx" by "AVx"
5082a36 Change "Vpx" to "Avx"
7df44f1 Replace "Vp9" w/ "Av1"
967f722 Remove kVp9CodecId
828f30c Change "Vp8" to "AOM"
030b5ff AUTHORS regenerated
2524cae Add ref-mv experimental flag
016762b Change copyright notice to AOMedia form
81e5526 Replace vp9 w/ av1
9b94565 Add missing files
fa8ca9f Change "vp9" to "av1"
ec838b7 Convert "vp8" to "aom"
80edfa0 Change "VP9" to "AV1"
d1a11fb Change "vp8" to "aom"
7b58251 Point to WebM test data
dd1a5c8 Replace "VP8" with "AOM"
ff00fc0 Change "VPX" to "AOM"
01dee0b Change "vp10" to "av1" in source code
cebe6f0 Convert "vpx" to "aom"
17b0567 rename vp10*.mk to av1_*.mk
fe5f8a8 rename files vp10_* to av1_*
Change-Id: I6fc3d18eb11fc171e46140c836ad5339cf6c9419
diff --git a/av1/encoder/encodemv.c b/av1/encoder/encodemv.c
index 78da2b7..a5e06a4 100644
--- a/av1/encoder/encodemv.c
+++ b/av1/encoder/encodemv.c
@@ -17,26 +17,26 @@
#include "av1/encoder/encodemv.h"
#include "av1/encoder/subexp.h"
-#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/aom_dsp_common.h"
-static struct vp10_token mv_joint_encodings[MV_JOINTS];
-static struct vp10_token mv_class_encodings[MV_CLASSES];
-static struct vp10_token mv_fp_encodings[MV_FP_SIZE];
-static struct vp10_token mv_class0_encodings[CLASS0_SIZE];
+static struct av1_token mv_joint_encodings[MV_JOINTS];
+static struct av1_token mv_class_encodings[MV_CLASSES];
+static struct av1_token mv_fp_encodings[MV_FP_SIZE];
+static struct av1_token mv_class0_encodings[CLASS0_SIZE];
-void vp10_entropy_mv_init(void) {
- vp10_tokens_from_tree(mv_joint_encodings, vp10_mv_joint_tree);
- vp10_tokens_from_tree(mv_class_encodings, vp10_mv_class_tree);
- vp10_tokens_from_tree(mv_class0_encodings, vp10_mv_class0_tree);
- vp10_tokens_from_tree(mv_fp_encodings, vp10_mv_fp_tree);
+void av1_entropy_mv_init(void) {
+ av1_tokens_from_tree(mv_joint_encodings, av1_mv_joint_tree);
+ av1_tokens_from_tree(mv_class_encodings, av1_mv_class_tree);
+ av1_tokens_from_tree(mv_class0_encodings, av1_mv_class0_tree);
+ av1_tokens_from_tree(mv_fp_encodings, av1_mv_fp_tree);
}
-static void encode_mv_component(vp10_writer *w, int comp,
+static void encode_mv_component(aom_writer *w, int comp,
const nmv_component *mvcomp, int usehp) {
int offset;
const int sign = comp < 0;
const int mag = sign ? -comp : comp;
- const int mv_class = vp10_get_mv_class(mag - 1, &offset);
+ const int mv_class = av1_get_mv_class(mag - 1, &offset);
const int d = offset >> 3; // int mv data
const int fr = (offset >> 1) & 3; // fractional mv data
const int hp = offset & 1; // high precision mv data
@@ -44,30 +44,30 @@
assert(comp != 0);
// Sign
- vp10_write(w, sign, mvcomp->sign);
+ aom_write(w, sign, mvcomp->sign);
// Class
- vp10_write_token(w, vp10_mv_class_tree, mvcomp->classes,
- &mv_class_encodings[mv_class]);
+ av1_write_token(w, av1_mv_class_tree, mvcomp->classes,
+ &mv_class_encodings[mv_class]);
// Integer bits
if (mv_class == MV_CLASS_0) {
- vp10_write_token(w, vp10_mv_class0_tree, mvcomp->class0,
- &mv_class0_encodings[d]);
+ av1_write_token(w, av1_mv_class0_tree, mvcomp->class0,
+ &mv_class0_encodings[d]);
} else {
int i;
const int n = mv_class + CLASS0_BITS - 1; // number of bits
- for (i = 0; i < n; ++i) vp10_write(w, (d >> i) & 1, mvcomp->bits[i]);
+ for (i = 0; i < n; ++i) aom_write(w, (d >> i) & 1, mvcomp->bits[i]);
}
// Fractional bits
- vp10_write_token(w, vp10_mv_fp_tree,
- mv_class == MV_CLASS_0 ? mvcomp->class0_fp[d] : mvcomp->fp,
- &mv_fp_encodings[fr]);
+ av1_write_token(w, av1_mv_fp_tree,
+ mv_class == MV_CLASS_0 ? mvcomp->class0_fp[d] : mvcomp->fp,
+ &mv_fp_encodings[fr]);
// High precision bit
if (usehp)
- vp10_write(w, hp, mv_class == MV_CLASS_0 ? mvcomp->class0_hp : mvcomp->hp);
+ aom_write(w, hp, mv_class == MV_CLASS_0 ? mvcomp->class0_hp : mvcomp->hp);
}
static void build_nmv_component_cost_table(int *mvcost,
@@ -79,30 +79,30 @@
int class0_fp_cost[CLASS0_SIZE][MV_FP_SIZE], fp_cost[MV_FP_SIZE];
int class0_hp_cost[2], hp_cost[2];
- sign_cost[0] = vp10_cost_zero(mvcomp->sign);
- sign_cost[1] = vp10_cost_one(mvcomp->sign);
- vp10_cost_tokens(class_cost, mvcomp->classes, vp10_mv_class_tree);
- vp10_cost_tokens(class0_cost, mvcomp->class0, vp10_mv_class0_tree);
+ sign_cost[0] = av1_cost_zero(mvcomp->sign);
+ sign_cost[1] = av1_cost_one(mvcomp->sign);
+ av1_cost_tokens(class_cost, mvcomp->classes, av1_mv_class_tree);
+ av1_cost_tokens(class0_cost, mvcomp->class0, av1_mv_class0_tree);
for (i = 0; i < MV_OFFSET_BITS; ++i) {
- bits_cost[i][0] = vp10_cost_zero(mvcomp->bits[i]);
- bits_cost[i][1] = vp10_cost_one(mvcomp->bits[i]);
+ bits_cost[i][0] = av1_cost_zero(mvcomp->bits[i]);
+ bits_cost[i][1] = av1_cost_one(mvcomp->bits[i]);
}
for (i = 0; i < CLASS0_SIZE; ++i)
- vp10_cost_tokens(class0_fp_cost[i], mvcomp->class0_fp[i], vp10_mv_fp_tree);
- vp10_cost_tokens(fp_cost, mvcomp->fp, vp10_mv_fp_tree);
+ av1_cost_tokens(class0_fp_cost[i], mvcomp->class0_fp[i], av1_mv_fp_tree);
+ av1_cost_tokens(fp_cost, mvcomp->fp, av1_mv_fp_tree);
if (usehp) {
- class0_hp_cost[0] = vp10_cost_zero(mvcomp->class0_hp);
- class0_hp_cost[1] = vp10_cost_one(mvcomp->class0_hp);
- hp_cost[0] = vp10_cost_zero(mvcomp->hp);
- hp_cost[1] = vp10_cost_one(mvcomp->hp);
+ class0_hp_cost[0] = av1_cost_zero(mvcomp->class0_hp);
+ class0_hp_cost[1] = av1_cost_one(mvcomp->class0_hp);
+ hp_cost[0] = av1_cost_zero(mvcomp->hp);
+ hp_cost[1] = av1_cost_one(mvcomp->hp);
}
mvcost[0] = 0;
for (v = 1; v <= MV_MAX; ++v) {
int z, c, o, d, e, f, cost = 0;
z = v - 1;
- c = vp10_get_mv_class(z, &o);
+ c = av1_get_mv_class(z, &o);
cost += class_cost[c];
d = (o >> 3); /* int mv data */
f = (o >> 1) & 3; /* fractional pel mv data */
@@ -131,48 +131,48 @@
}
}
-static void update_mv(vp10_writer *w, const unsigned int ct[2], vpx_prob *cur_p,
- vpx_prob upd_p) {
+static void update_mv(aom_writer *w, const unsigned int ct[2], aom_prob *cur_p,
+ aom_prob upd_p) {
(void)upd_p;
- vp10_cond_prob_diff_update(w, cur_p, ct);
+ av1_cond_prob_diff_update(w, cur_p, ct);
}
-static void write_mv_update(const vpx_tree_index *tree,
- vpx_prob probs[/*n - 1*/],
+static void write_mv_update(const aom_tree_index *tree,
+ aom_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], int n,
- vp10_writer *w) {
+ aom_writer *w) {
int i;
unsigned int branch_ct[32][2];
// Assuming max number of probabilities <= 32
assert(n <= 32);
- vp10_tree_probs_from_distribution(tree, branch_ct, counts);
+ av1_tree_probs_from_distribution(tree, branch_ct, counts);
for (i = 0; i < n - 1; ++i)
update_mv(w, branch_ct[i], &probs[i], MV_UPDATE_PROB);
}
-void vp10_write_nmv_probs(VP10_COMMON *cm, int usehp, vp10_writer *w,
- nmv_context_counts *const nmv_counts) {
+void aom_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
+ nmv_context_counts *const nmv_counts) {
int i, j;
#if CONFIG_REF_MV
int nmv_ctx = 0;
for (nmv_ctx = 0; nmv_ctx < NMV_CONTEXTS; ++nmv_ctx) {
nmv_context *const mvc = &cm->fc->nmvc[nmv_ctx];
nmv_context_counts *const counts = &nmv_counts[nmv_ctx];
- write_mv_update(vp10_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS,
+ write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS,
w);
- vp10_cond_prob_diff_update(w, &mvc->zero_rmv, counts->zero_rmv);
+ av1_cond_prob_diff_update(w, &mvc->zero_rmv, counts->zero_rmv);
for (i = 0; i < 2; ++i) {
nmv_component *comp = &mvc->comps[i];
nmv_component_counts *comp_counts = &counts->comps[i];
update_mv(w, comp_counts->sign, &comp->sign, MV_UPDATE_PROB);
- write_mv_update(vp10_mv_class_tree, comp->classes, comp_counts->classes,
+ write_mv_update(av1_mv_class_tree, comp->classes, comp_counts->classes,
MV_CLASSES, w);
- write_mv_update(vp10_mv_class0_tree, comp->class0, comp_counts->class0,
+ write_mv_update(av1_mv_class0_tree, comp->class0, comp_counts->class0,
CLASS0_SIZE, w);
for (j = 0; j < MV_OFFSET_BITS; ++j)
update_mv(w, comp_counts->bits[j], &comp->bits[j], MV_UPDATE_PROB);
@@ -180,10 +180,10 @@
for (i = 0; i < 2; ++i) {
for (j = 0; j < CLASS0_SIZE; ++j)
- write_mv_update(vp10_mv_fp_tree, mvc->comps[i].class0_fp[j],
+ write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
counts->comps[i].class0_fp[j], MV_FP_SIZE, w);
- write_mv_update(vp10_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
+ write_mv_update(av1_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
MV_FP_SIZE, w);
}
@@ -199,17 +199,16 @@
nmv_context *const mvc = &cm->fc->nmvc;
nmv_context_counts *const counts = nmv_counts;
- write_mv_update(vp10_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS,
- w);
+ write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w);
for (i = 0; i < 2; ++i) {
nmv_component *comp = &mvc->comps[i];
nmv_component_counts *comp_counts = &counts->comps[i];
update_mv(w, comp_counts->sign, &comp->sign, MV_UPDATE_PROB);
- write_mv_update(vp10_mv_class_tree, comp->classes, comp_counts->classes,
+ write_mv_update(av1_mv_class_tree, comp->classes, comp_counts->classes,
MV_CLASSES, w);
- write_mv_update(vp10_mv_class0_tree, comp->class0, comp_counts->class0,
+ write_mv_update(av1_mv_class0_tree, comp->class0, comp_counts->class0,
CLASS0_SIZE, w);
for (j = 0; j < MV_OFFSET_BITS; ++j)
update_mv(w, comp_counts->bits[j], &comp->bits[j], MV_UPDATE_PROB);
@@ -217,10 +216,10 @@
for (i = 0; i < 2; ++i) {
for (j = 0; j < CLASS0_SIZE; ++j)
- write_mv_update(vp10_mv_fp_tree, mvc->comps[i].class0_fp[j],
+ write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
counts->comps[i].class0_fp[j], MV_FP_SIZE, w);
- write_mv_update(vp10_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
+ write_mv_update(av1_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
MV_FP_SIZE, w);
}
@@ -234,18 +233,18 @@
#endif
}
-void vp10_encode_mv(VP10_COMP *cpi, vp10_writer *w, const MV *mv, const MV *ref,
+void av1_encode_mv(AV1_COMP *cpi, aom_writer *w, const MV *mv, const MV *ref,
#if CONFIG_REF_MV
- int is_compound,
+ int is_compound,
#endif
- const nmv_context *mvctx, int usehp) {
+ const nmv_context *mvctx, int usehp) {
const MV diff = { mv->row - ref->row, mv->col - ref->col };
- const MV_JOINT_TYPE j = vp10_get_mv_joint(&diff);
- usehp = usehp && vp10_use_mv_hp(ref);
+ const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
+ usehp = usehp && av1_use_mv_hp(ref);
#if CONFIG_REF_MV && !CONFIG_EXT_INTER
if (is_compound) {
- vp10_write(w, (j == MV_JOINT_ZERO), mvctx->zero_rmv);
+ aom_write(w, (j == MV_JOINT_ZERO), mvctx->zero_rmv);
if (j == MV_JOINT_ZERO) return;
} else {
if (j == MV_JOINT_ZERO) assert(0);
@@ -256,8 +255,7 @@
(void)is_compound;
#endif
- vp10_write_token(w, vp10_mv_joint_tree, mvctx->joints,
- &mv_joint_encodings[j]);
+ av1_write_token(w, av1_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]);
if (mv_joint_vertical(j))
encode_mv_component(w, diff.row, &mvctx->comps[0], usehp);
@@ -267,14 +265,14 @@
// If auto_mv_step_size is enabled then keep track of the largest
// motion vector component used.
if (cpi->sf.mv.auto_mv_step_size) {
- unsigned int maxv = VPXMAX(abs(mv->row), abs(mv->col)) >> 3;
- cpi->max_mv_magnitude = VPXMAX(maxv, cpi->max_mv_magnitude);
+ unsigned int maxv = AOMMAX(abs(mv->row), abs(mv->col)) >> 3;
+ cpi->max_mv_magnitude = AOMMAX(maxv, cpi->max_mv_magnitude);
}
}
-void vp10_build_nmv_cost_table(int *mvjoint, int *mvcost[2],
- const nmv_context *ctx, int usehp) {
- vp10_cost_tokens(mvjoint, ctx->joints, vp10_mv_joint_tree);
+void av1_build_nmv_cost_table(int *mvjoint, int *mvcost[2],
+ const nmv_context *ctx, int usehp) {
+ av1_cost_tokens(mvjoint, ctx->joints, av1_mv_joint_tree);
build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], usehp);
build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp);
}
@@ -299,33 +297,33 @@
const MV diff = { mvs[i].as_mv.row - ref->row,
mvs[i].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
(void)pred_mvs;
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
}
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[1]][0].as_mv;
const MV diff = { mvs[1].as_mv.row - ref->row,
mvs[1].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[1]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[1]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[1]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[1]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
} else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[0]][0].as_mv;
const MV diff = { mvs[0].as_mv.row - ref->row,
mvs[0].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[0]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[0]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[0]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[0]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
}
}
@@ -348,32 +346,32 @@
const MV diff = { mvs[i].as_mv.row - ref->row,
mvs[i].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
}
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
const MV *ref = &mi->bmi[block].ref_mv[1].as_mv;
const MV diff = { mvs[1].as_mv.row - ref->row,
mvs[1].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[1]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[1]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[1]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[1]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
} else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
const MV *ref = &mi->bmi[block].ref_mv[0].as_mv;
const MV diff = { mvs[0].as_mv.row - ref->row,
mvs[0].as_mv.col - ref->col };
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[0]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[0]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[0]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[0]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
}
}
#else
@@ -390,8 +388,8 @@
for (i = 0; i < 1 + has_second_ref(mbmi); ++i) {
#if CONFIG_REF_MV
- int nmv_ctx = vp10_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
- mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
+ int nmv_ctx = av1_nmv_ctx(mbmi_ext->ref_mv_count[mbmi->ref_frame[i]],
+ mbmi_ext->ref_mv_stack[mbmi->ref_frame[i]]);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
const MV *ref = &pred_mvs[i].as_mv;
#else
@@ -399,12 +397,12 @@
#endif
const MV diff = { mvs[i].as_mv.row - ref->row,
mvs[i].as_mv.col - ref->col };
- vp10_inc_mv(&diff, counts, vp10_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
}
}
#endif // CONFIG_EXT_INTER
-void vp10_update_mv_count(ThreadData *td) {
+void av1_update_mv_count(ThreadData *td) {
const MACROBLOCKD *xd = &td->mb.e_mbd;
const MODE_INFO *mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;