38 VP56mv *pmv,
int ref,
int z,
int idx,
int sb)
40 static const int8_t mv_ref_blk_off[
N_BS_SIZES][8][2] = {
41 [
BS_64x64] = { { 3, -1 }, { -1, 3 }, { 4, -1 }, { -1, 4 },
42 { -1, -1 }, { 0, -1 }, { -1, 0 }, { 6, -1 } },
43 [
BS_64x32] = { { 0, -1 }, { -1, 0 }, { 4, -1 }, { -1, 2 },
44 { -1, -1 }, { 0, -3 }, { -3, 0 }, { 2, -1 } },
45 [
BS_32x64] = { { -1, 0 }, { 0, -1 }, { -1, 4 }, { 2, -1 },
46 { -1, -1 }, { -3, 0 }, { 0, -3 }, { -1, 2 } },
47 [
BS_32x32] = { { 1, -1 }, { -1, 1 }, { 2, -1 }, { -1, 2 },
48 { -1, -1 }, { 0, -3 }, { -3, 0 }, { -3, -3 } },
49 [
BS_32x16] = { { 0, -1 }, { -1, 0 }, { 2, -1 }, { -1, -1 },
50 { -1, 1 }, { 0, -3 }, { -3, 0 }, { -3, -3 } },
51 [
BS_16x32] = { { -1, 0 }, { 0, -1 }, { -1, 2 }, { -1, -1 },
52 { 1, -1 }, { -3, 0 }, { 0, -3 }, { -3, -3 } },
53 [
BS_16x16] = { { 0, -1 }, { -1, 0 }, { 1, -1 }, { -1, 1 },
54 { -1, -1 }, { 0, -3 }, { -3, 0 }, { -3, -3 } },
55 [
BS_16x8] = { { 0, -1 }, { -1, 0 }, { 1, -1 }, { -1, -1 },
56 { 0, -2 }, { -2, 0 }, { -2, -1 }, { -1, -2 } },
57 [
BS_8x16] = { { -1, 0 }, { 0, -1 }, { -1, 1 }, { -1, -1 },
58 { -2, 0 }, { 0, -2 }, { -1, -2 }, { -2, -1 } },
59 [
BS_8x8] = { { 0, -1 }, { -1, 0 }, { -1, -1 }, { 0, -2 },
60 { -2, 0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
61 [
BS_8x4] = { { 0, -1 }, { -1, 0 }, { -1, -1 }, { 0, -2 },
62 { -2, 0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
63 [
BS_4x8] = { { 0, -1 }, { -1, 0 }, { -1, -1 }, { 0, -2 },
64 { -2, 0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
65 [
BS_4x4] = { { 0, -1 }, { -1, 0 }, { -1, -1 }, { 0, -2 },
66 { -2, 0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
69 int row = s->
row, col = s->
col, row7 = s->
row7;
70 const int8_t (*p)[2] = mv_ref_blk_off[b->
bs];
71 #define INVALID_MV 0x80008000U
75 #define RETURN_DIRECT_MV(mv) \
77 uint32_t m = AV_RN32A(&mv); \
81 } else if (mem == INVALID_MV) { \
83 } else if (m != mem) { \
90 if (sb == 2 || sb == 1) {
98 #define RETURN_MV(mv) \
103 av_assert2(idx == 1); \
104 av_assert2(mem != INVALID_MV); \
105 if (mem_sub8x8 == INVALID_MV) { \
106 clamp_mv(&tmp, &mv, s); \
107 m = AV_RN32A(&tmp); \
112 mem_sub8x8 = AV_RN32A(&mv); \
113 } else if (mem_sub8x8 != AV_RN32A(&mv)) { \
114 clamp_mv(&tmp, &mv, s); \
115 m = AV_RN32A(&tmp); \
125 uint32_t m = AV_RN32A(&mv); \
127 clamp_mv(pmv, &mv, s); \
129 } else if (mem == INVALID_MV) { \
131 } else if (m != mem) { \
132 clamp_mv(pmv, &mv, s); \
140 if (mv->
ref[0] == ref)
142 else if (mv->
ref[1] == ref)
147 if (mv->
ref[0] == ref)
149 else if (mv->
ref[1] == ref)
159 int c = p[i][0] + col,
r = p[i][1] + row;
162 r >= 0 && r < s->rows) {
165 if (mv->
ref[0] == ref)
167 else if (mv->
ref[1] == ref)
178 if (mv->
ref[0] == ref)
180 else if (mv->
ref[1] == ref)
184 #define RETURN_SCALE_MV(mv, scale) \
187 VP56mv mv_temp = { -mv.x, -mv.y }; \
188 RETURN_MV(mv_temp); \
195 for (i = 0; i < 8; i++) {
196 int c = p[i][0] + col,
r = p[i][1] + row;
198 if (c >= s->
tile_col_start && c < s->cols && r >= 0 && r < s->rows) {
201 if (mv->
ref[0] != ref && mv->
ref[0] >= 0)
204 if (mv->
ref[1] != ref && mv->
ref[1] >= 0 &&
218 if (mv->
ref[0] != ref && mv->
ref[0] >= 0)
220 if (mv->
ref[1] != ref && mv->
ref[1] >= 0 &&
232 #undef RETURN_SCALE_MV
246 for (n = 0, m = 0; m <
c; m++) {
273 n = (n << 3) | (bit << 1);
286 return sign ? -(n + 1) : (n + 1);
300 mode ==
NEWMV ? -1 : sb);
302 if ((mode ==
NEWMV || sb == -1) &&
304 abs(mv[0].x) < 64 && abs(mv[0].y) < 64)) {
332 mode ==
NEWMV ? -1 : sb);
333 if ((mode ==
NEWMV || sb == -1) &&
335 abs(mv[1].x) < 64 && abs(mv[1].y) < 64)) {
const int8_t ff_vp9_mv_joint_tree[3][2]
VP5 and VP6 compatible video decoder (common features)
static av_always_inline int vp8_rac_get_tree(VP56RangeCoder *c, const int8_t(*tree)[2], const uint8_t *probs)
struct ProbContext::@145 mv_comp[2]
void ff_thread_await_progress(ThreadFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
const int8_t ff_vp9_mv_class_tree[10][2]
struct VP9Context::@149::@151 mv_comp[2]
static av_always_inline void clamp_mv(VP56mv *dst, const VP56mv *src, VP9Context *s)
const int8_t ff_vp9_mv_fp_tree[3][2]
VP56mv left_mv_ctx[16][2]
#define vp56_rac_get_prob
#define RETURN_SCALE_MV(mv, scale)
static const int8_t mv[256][2]
VP56mv(* above_mv_ctx)[2]
static void find_ref_mvs(VP9Context *s, VP56mv *pmv, int ref, int z, int idx, int sb)
static av_always_inline int read_mv_component(VP9Context *s, int idx, int hp)
common internal api header.
static int ref[MAX_W *MAX_W]
void ff_vp9_fill_mv(VP9Context *s, VP56mv *mv, int mode, int sb)
struct VP9Context::@148 prob
#define RETURN_DIRECT_MV(mv)
struct VP9Context::@149 counts
struct VP9Context::@150 min_mv
struct VP9Context::@150 max_mv
mode
Use these values in ebur128_init (or'ed).