Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yushin Cho
aom-rav1e
Commits
7da965da
Commit
7da965da
authored
Aug 13, 2015
by
Yaowu Xu
Committed by
Gerrit Code Review
Aug 13, 2015
Browse files
Merge "VP9_COMMON -> VP10->COMMON"
parents
7bca5619
fc7cbd1f
Changes
46
Hide whitespace changes
Inline
Side-by-side
vp10/common/alloccommon.c
View file @
7da965da
...
...
@@ -17,7 +17,7 @@
#include
"vp10/common/entropymv.h"
#include
"vp10/common/onyxc_int.h"
void
vp10_set_mb_mi
(
VP
9
_COMMON
*
cm
,
int
width
,
int
height
)
{
void
vp10_set_mb_mi
(
VP
10
_COMMON
*
cm
,
int
width
,
int
height
)
{
const
int
aligned_width
=
ALIGN_POWER_OF_TWO
(
width
,
MI_SIZE_LOG2
);
const
int
aligned_height
=
ALIGN_POWER_OF_TWO
(
height
,
MI_SIZE_LOG2
);
...
...
@@ -30,7 +30,7 @@ void vp10_set_mb_mi(VP9_COMMON *cm, int width, int height) {
cm
->
MBs
=
cm
->
mb_rows
*
cm
->
mb_cols
;
}
static
int
alloc_seg_map
(
VP
9
_COMMON
*
cm
,
int
seg_map_size
)
{
static
int
alloc_seg_map
(
VP
10
_COMMON
*
cm
,
int
seg_map_size
)
{
int
i
;
for
(
i
=
0
;
i
<
NUM_PING_PONG_BUFFERS
;
++
i
)
{
...
...
@@ -51,7 +51,7 @@ static int alloc_seg_map(VP9_COMMON *cm, int seg_map_size) {
return
0
;
}
static
void
free_seg_map
(
VP
9
_COMMON
*
cm
)
{
static
void
free_seg_map
(
VP
10
_COMMON
*
cm
)
{
int
i
;
for
(
i
=
0
;
i
<
NUM_PING_PONG_BUFFERS
;
++
i
)
{
...
...
@@ -81,7 +81,7 @@ void vp10_free_ref_frame_buffers(BufferPool *pool) {
}
}
void
vp10_free_postproc_buffers
(
VP
9
_COMMON
*
cm
)
{
void
vp10_free_postproc_buffers
(
VP
10
_COMMON
*
cm
)
{
#if CONFIG_VP9_POSTPROC
vp9_free_frame_buffer
(
&
cm
->
post_proc_buffer
);
vp9_free_frame_buffer
(
&
cm
->
post_proc_buffer_int
);
...
...
@@ -90,7 +90,7 @@ void vp10_free_postproc_buffers(VP9_COMMON *cm) {
#endif
}
void
vp10_free_context_buffers
(
VP
9
_COMMON
*
cm
)
{
void
vp10_free_context_buffers
(
VP
10
_COMMON
*
cm
)
{
cm
->
free_mi
(
cm
);
free_seg_map
(
cm
);
vpx_free
(
cm
->
above_context
);
...
...
@@ -99,7 +99,7 @@ void vp10_free_context_buffers(VP9_COMMON *cm) {
cm
->
above_seg_context
=
NULL
;
}
int
vp10_alloc_context_buffers
(
VP
9
_COMMON
*
cm
,
int
width
,
int
height
)
{
int
vp10_alloc_context_buffers
(
VP
10
_COMMON
*
cm
,
int
width
,
int
height
)
{
int
new_mi_size
;
vp10_set_mb_mi
(
cm
,
width
,
height
);
...
...
@@ -138,7 +138,7 @@ int vp10_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
return
1
;
}
void
vp10_remove_common
(
VP
9
_COMMON
*
cm
)
{
void
vp10_remove_common
(
VP
10
_COMMON
*
cm
)
{
vp10_free_context_buffers
(
cm
);
vpx_free
(
cm
->
fc
);
...
...
@@ -147,13 +147,13 @@ void vp10_remove_common(VP9_COMMON *cm) {
cm
->
frame_contexts
=
NULL
;
}
void
vp10_init_context_buffers
(
VP
9
_COMMON
*
cm
)
{
void
vp10_init_context_buffers
(
VP
10
_COMMON
*
cm
)
{
cm
->
setup_mi
(
cm
);
if
(
cm
->
last_frame_seg_map
&&
!
cm
->
frame_parallel_decode
)
memset
(
cm
->
last_frame_seg_map
,
0
,
cm
->
mi_rows
*
cm
->
mi_cols
);
}
void
vp10_swap_current_and_last_seg_map
(
VP
9
_COMMON
*
cm
)
{
void
vp10_swap_current_and_last_seg_map
(
VP
10
_COMMON
*
cm
)
{
// Swap indices.
const
int
tmp
=
cm
->
seg_map_idx
;
cm
->
seg_map_idx
=
cm
->
prev_seg_map_idx
;
...
...
vp10/common/debugmodes.c
View file @
7da965da
...
...
@@ -13,7 +13,7 @@
#include
"vp10/common/blockd.h"
#include
"vp10/common/onyxc_int.h"
static
void
log_frame_info
(
VP
9
_COMMON
*
cm
,
const
char
*
str
,
FILE
*
f
)
{
static
void
log_frame_info
(
VP
10
_COMMON
*
cm
,
const
char
*
str
,
FILE
*
f
)
{
fprintf
(
f
,
"%s"
,
str
);
fprintf
(
f
,
"(Frame %d, Show:%d, Q:%d):
\n
"
,
cm
->
current_video_frame
,
cm
->
show_frame
,
cm
->
base_qindex
);
...
...
@@ -22,7 +22,7 @@ static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
* and uses the passed in member offset to print out the value of an integer
* for each mbmi member value in the mi structure.
*/
static
void
print_mi_data
(
VP
9
_COMMON
*
cm
,
FILE
*
file
,
const
char
*
descriptor
,
static
void
print_mi_data
(
VP
10
_COMMON
*
cm
,
FILE
*
file
,
const
char
*
descriptor
,
size_t
member_offset
)
{
int
mi_row
,
mi_col
;
MODE_INFO
**
mi
=
cm
->
mi_grid_visible
;
...
...
@@ -45,7 +45,7 @@ static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
fprintf
(
file
,
"
\n
"
);
}
void
vp10_print_modes_and_motion_vectors
(
VP
9
_COMMON
*
cm
,
const
char
*
file
)
{
void
vp10_print_modes_and_motion_vectors
(
VP
10
_COMMON
*
cm
,
const
char
*
file
)
{
int
mi_row
;
int
mi_col
;
FILE
*
mvs
=
fopen
(
file
,
"a"
);
...
...
vp10/common/entropy.c
View file @
7da965da
...
...
@@ -753,7 +753,7 @@ void vp10_model_to_full_probs(const vpx_prob *model, vpx_prob *full) {
extend_to_full_distribution
(
&
full
[
UNCONSTRAINED_NODES
],
model
[
PIVOT_NODE
]);
}
void
vp10_default_coef_probs
(
VP
9
_COMMON
*
cm
)
{
void
vp10_default_coef_probs
(
VP
10
_COMMON
*
cm
)
{
vp10_copy
(
cm
->
fc
->
coef_probs
[
TX_4X4
],
default_coef_probs_4x4
);
vp10_copy
(
cm
->
fc
->
coef_probs
[
TX_8X8
],
default_coef_probs_8x8
);
vp10_copy
(
cm
->
fc
->
coef_probs
[
TX_16X16
],
default_coef_probs_16x16
);
...
...
@@ -767,7 +767,7 @@ void vp10_default_coef_probs(VP9_COMMON *cm) {
#define COEF_COUNT_SAT_AFTER_KEY 24
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
static
void
adapt_coef_probs
(
VP
9
_COMMON
*
cm
,
TX_SIZE
tx_size
,
static
void
adapt_coef_probs
(
VP
10
_COMMON
*
cm
,
TX_SIZE
tx_size
,
unsigned
int
count_sat
,
unsigned
int
update_factor
)
{
const
FRAME_CONTEXT
*
pre_fc
=
&
cm
->
frame_contexts
[
cm
->
frame_context_idx
];
...
...
@@ -798,7 +798,7 @@ static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
}
}
void
vp10_adapt_coef_probs
(
VP
9
_COMMON
*
cm
)
{
void
vp10_adapt_coef_probs
(
VP
10
_COMMON
*
cm
)
{
TX_SIZE
t
;
unsigned
int
count_sat
,
update_factor
;
...
...
vp10/common/entropymode.c
View file @
7da965da
...
...
@@ -334,7 +334,7 @@ const vpx_tree_index vp10_switchable_interp_tree
-
EIGHTTAP_SMOOTH
,
-
EIGHTTAP_SHARP
};
void
vp10_adapt_mode_probs
(
VP
9
_COMMON
*
cm
)
{
void
vp10_adapt_mode_probs
(
VP
10
_COMMON
*
cm
)
{
int
i
,
j
;
FRAME_CONTEXT
*
fc
=
cm
->
fc
;
const
FRAME_CONTEXT
*
pre_fc
=
&
cm
->
frame_contexts
[
cm
->
frame_context_idx
];
...
...
@@ -420,7 +420,7 @@ static void set_default_lf_deltas(struct loopfilter *lf) {
lf
->
mode_deltas
[
1
]
=
0
;
}
void
vp10_setup_past_independence
(
VP
9
_COMMON
*
cm
)
{
void
vp10_setup_past_independence
(
VP
10
_COMMON
*
cm
)
{
// Reset the segment feature data to the default stats:
// Features disabled, 0, with delta coding (Default state).
struct
loopfilter
*
const
lf
=
&
cm
->
lf
;
...
...
vp10/common/entropymv.c
View file @
7da965da
...
...
@@ -176,7 +176,7 @@ void vp10_inc_mv(const MV *mv, nmv_context_counts *counts) {
}
}
void
vp10_adapt_mv_probs
(
VP
9
_COMMON
*
cm
,
int
allow_hp
)
{
void
vp10_adapt_mv_probs
(
VP
10
_COMMON
*
cm
,
int
allow_hp
)
{
int
i
,
j
;
nmv_context
*
fc
=
&
cm
->
fc
->
nmvc
;
...
...
@@ -213,6 +213,6 @@ void vp10_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
}
}
void
vp10_init_mv_probs
(
VP
9
_COMMON
*
cm
)
{
void
vp10_init_mv_probs
(
VP
10
_COMMON
*
cm
)
{
cm
->
fc
->
nmvc
=
default_nmv_context
;
}
vp10/common/loopfilter.c
View file @
7da965da
...
...
@@ -236,7 +236,7 @@ static uint8_t get_filter_level(const loop_filter_info_n *lfi_n,
[
mode_lf_lut
[
mbmi
->
mode
]];
}
void
vp10_loop_filter_init
(
VP
9
_COMMON
*
cm
)
{
void
vp10_loop_filter_init
(
VP
10
_COMMON
*
cm
)
{
loop_filter_info_n
*
lfi
=
&
cm
->
lf_info
;
struct
loopfilter
*
lf
=
&
cm
->
lf
;
int
lvl
;
...
...
@@ -250,7 +250,7 @@ void vp10_loop_filter_init(VP9_COMMON *cm) {
memset
(
lfi
->
lfthr
[
lvl
].
hev_thr
,
(
lvl
>>
4
),
SIMD_WIDTH
);
}
void
vp10_loop_filter_frame_init
(
VP
9
_COMMON
*
cm
,
int
default_filt_lvl
)
{
void
vp10_loop_filter_frame_init
(
VP
10
_COMMON
*
cm
,
int
default_filt_lvl
)
{
int
seg_id
;
// n_shift is the multiplier for lf_deltas
// the multiplier is 1 for when filter_lvl is between 0 and 31;
...
...
@@ -827,7 +827,7 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
// This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col.
// TODO(JBB): This function only works for yv12.
void
vp10_setup_mask
(
VP
9
_COMMON
*
const
cm
,
const
int
mi_row
,
const
int
mi_col
,
void
vp10_setup_mask
(
VP
10
_COMMON
*
const
cm
,
const
int
mi_row
,
const
int
mi_col
,
MODE_INFO
**
mi
,
const
int
mode_info_stride
,
LOOP_FILTER_MASK
*
lfm
)
{
int
idx_32
,
idx_16
,
idx_8
;
...
...
@@ -1151,7 +1151,7 @@ static void highbd_filter_selectively_vert(uint16_t *s, int pitch,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
void
vp10_filter_block_plane_non420
(
VP
9
_COMMON
*
cm
,
void
vp10_filter_block_plane_non420
(
VP
10
_COMMON
*
cm
,
struct
macroblockd_plane
*
plane
,
MODE_INFO
**
mi_8x8
,
int
mi_row
,
int
mi_col
)
{
...
...
@@ -1328,7 +1328,7 @@ void vp10_filter_block_plane_non420(VP9_COMMON *cm,
}
}
void
vp10_filter_block_plane_ss00
(
VP
9
_COMMON
*
const
cm
,
void
vp10_filter_block_plane_ss00
(
VP
10
_COMMON
*
const
cm
,
struct
macroblockd_plane
*
const
plane
,
int
mi_row
,
LOOP_FILTER_MASK
*
lfm
)
{
...
...
@@ -1420,7 +1420,7 @@ void vp10_filter_block_plane_ss00(VP9_COMMON *const cm,
}
}
void
vp10_filter_block_plane_ss11
(
VP
9
_COMMON
*
const
cm
,
void
vp10_filter_block_plane_ss11
(
VP
10
_COMMON
*
const
cm
,
struct
macroblockd_plane
*
const
plane
,
int
mi_row
,
LOOP_FILTER_MASK
*
lfm
)
{
...
...
@@ -1529,7 +1529,7 @@ void vp10_filter_block_plane_ss11(VP9_COMMON *const cm,
}
void
vp10_loop_filter_rows
(
YV12_BUFFER_CONFIG
*
frame_buffer
,
VP
9
_COMMON
*
cm
,
VP
10
_COMMON
*
cm
,
struct
macroblockd_plane
planes
[
MAX_MB_PLANE
],
int
start
,
int
stop
,
int
y_only
)
{
const
int
num_planes
=
y_only
?
1
:
MAX_MB_PLANE
;
...
...
@@ -1578,7 +1578,7 @@ void vp10_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer,
}
void
vp10_loop_filter_frame
(
YV12_BUFFER_CONFIG
*
frame
,
VP
9
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
VP
10
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
frame_filter_level
,
int
y_only
,
int
partial_frame
)
{
int
start_mi_row
,
end_mi_row
,
mi_rows_to_filter
;
...
...
vp10/common/mfqe.c
View file @
7da965da
...
...
@@ -214,7 +214,7 @@ static int mfqe_decision(MODE_INFO *mi, BLOCK_SIZE cur_bs) {
}
// Process each partiton in a super block, recursively.
static
void
mfqe_partition
(
VP
9
_COMMON
*
cm
,
MODE_INFO
*
mi
,
BLOCK_SIZE
bs
,
static
void
mfqe_partition
(
VP
10
_COMMON
*
cm
,
MODE_INFO
*
mi
,
BLOCK_SIZE
bs
,
const
uint8_t
*
y
,
const
uint8_t
*
u
,
const
uint8_t
*
v
,
int
y_stride
,
int
uv_stride
,
uint8_t
*
yd
,
uint8_t
*
ud
,
uint8_t
*
vd
,
...
...
@@ -349,7 +349,7 @@ static void mfqe_partition(VP9_COMMON *cm, MODE_INFO *mi, BLOCK_SIZE bs,
}
}
void
vp10_mfqe
(
VP
9
_COMMON
*
cm
)
{
void
vp10_mfqe
(
VP
10
_COMMON
*
cm
)
{
int
mi_row
,
mi_col
;
// Current decoded frame.
const
YV12_BUFFER_CONFIG
*
show
=
cm
->
frame_to_show
;
...
...
vp10/common/mvref_common.c
View file @
7da965da
...
...
@@ -13,7 +13,7 @@
// This function searches the neighbourhood of a given MB/SB
// to try and find candidate reference vectors.
static
void
find_mv_refs_idx
(
const
VP
9
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
static
void
find_mv_refs_idx
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
MODE_INFO
*
mi
,
MV_REFERENCE_FRAME
ref_frame
,
int_mv
*
mv_ref_list
,
int
block
,
int
mi_row
,
int
mi_col
,
...
...
@@ -146,7 +146,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
clamp_mv_ref
(
&
mv_ref_list
[
i
].
as_mv
,
xd
);
}
void
vp10_find_mv_refs
(
const
VP
9
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
void
vp10_find_mv_refs
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
MODE_INFO
*
mi
,
MV_REFERENCE_FRAME
ref_frame
,
int_mv
*
mv_ref_list
,
int
mi_row
,
int
mi_col
,
...
...
@@ -179,7 +179,7 @@ void vp10_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
*
near_mv
=
mvlist
[
1
];
}
void
vp10_append_sub8x8_mvs_for_idx
(
VP
9
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
void
vp10_append_sub8x8_mvs_for_idx
(
VP
10
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
block
,
int
ref
,
int
mi_row
,
int
mi_col
,
int_mv
*
nearest_mv
,
int_mv
*
near_mv
,
uint8_t
*
mode_context
)
{
...
...
vp10/common/mvref_common.h
View file @
7da965da
...
...
@@ -208,7 +208,7 @@ static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
}
typedef
void
(
*
find_mv_refs_sync
)(
void
*
const
data
,
int
mi_row
);
void
vp10_find_mv_refs
(
const
VP
9
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
void
vp10_find_mv_refs
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
MODE_INFO
*
mi
,
MV_REFERENCE_FRAME
ref_frame
,
int_mv
*
mv_ref_list
,
int
mi_row
,
int
mi_col
,
find_mv_refs_sync
sync
,
void
*
const
data
,
...
...
@@ -220,7 +220,7 @@ void vp10_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
void
vp10_find_best_ref_mvs
(
MACROBLOCKD
*
xd
,
int
allow_hp
,
int_mv
*
mvlist
,
int_mv
*
nearest_mv
,
int_mv
*
near_mv
);
void
vp10_append_sub8x8_mvs_for_idx
(
VP
9
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
void
vp10_append_sub8x8_mvs_for_idx
(
VP
10
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
block
,
int
ref
,
int
mi_row
,
int
mi_col
,
int_mv
*
nearest_mv
,
int_mv
*
near_mv
,
uint8_t
*
mode_context
);
...
...
vp10/common/onyxc_int.h
View file @
7da965da
...
...
@@ -275,7 +275,7 @@ typedef struct VP9Common {
PARTITION_CONTEXT
*
above_seg_context
;
ENTROPY_CONTEXT
*
above_context
;
int
above_context_alloc_cols
;
}
VP
9
_COMMON
;
}
VP
10
_COMMON
;
// TODO(hkuang): Don't need to lock the whole pool after implementing atomic
// frame reference count.
...
...
@@ -295,7 +295,7 @@ static void unlock_buffer_pool(BufferPool *const pool) {
#endif
}
static
INLINE
YV12_BUFFER_CONFIG
*
get_ref_frame
(
VP
9
_COMMON
*
cm
,
int
index
)
{
static
INLINE
YV12_BUFFER_CONFIG
*
get_ref_frame
(
VP
10
_COMMON
*
cm
,
int
index
)
{
if
(
index
<
0
||
index
>=
REF_FRAMES
)
return
NULL
;
if
(
cm
->
ref_frame_map
[
index
]
<
0
)
...
...
@@ -304,11 +304,11 @@ static INLINE YV12_BUFFER_CONFIG *get_ref_frame(VP9_COMMON *cm, int index) {
return
&
cm
->
buffer_pool
->
frame_bufs
[
cm
->
ref_frame_map
[
index
]].
buf
;
}
static
INLINE
YV12_BUFFER_CONFIG
*
get_frame_new_buffer
(
VP
9
_COMMON
*
cm
)
{
static
INLINE
YV12_BUFFER_CONFIG
*
get_frame_new_buffer
(
VP
10
_COMMON
*
cm
)
{
return
&
cm
->
buffer_pool
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
;
}
static
INLINE
int
get_free_fb
(
VP
9
_COMMON
*
cm
)
{
static
INLINE
int
get_free_fb
(
VP
10
_COMMON
*
cm
)
{
RefCntBuffer
*
const
frame_bufs
=
cm
->
buffer_pool
->
frame_bufs
;
int
i
;
...
...
@@ -343,11 +343,11 @@ static INLINE int mi_cols_aligned_to_sb(int n_mis) {
return
ALIGN_POWER_OF_TWO
(
n_mis
,
MI_BLOCK_SIZE_LOG2
);
}
static
INLINE
int
frame_is_intra_only
(
const
VP
9
_COMMON
*
const
cm
)
{
static
INLINE
int
frame_is_intra_only
(
const
VP
10
_COMMON
*
const
cm
)
{
return
cm
->
frame_type
==
KEY_FRAME
||
cm
->
intra_only
;
}
static
INLINE
void
set_partition_probs
(
const
VP
9
_COMMON
*
const
cm
,
static
INLINE
void
set_partition_probs
(
const
VP
10
_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
)
{
xd
->
partition_probs
=
frame_is_intra_only
(
cm
)
?
...
...
@@ -355,7 +355,7 @@ static INLINE void set_partition_probs(const VP9_COMMON *const cm,
(
const
vpx_prob
(
*
)[
PARTITION_TYPES
-
1
])
cm
->
fc
->
partition_prob
;
}
static
INLINE
void
vp10_init_macroblockd
(
VP
9
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
static
INLINE
void
vp10_init_macroblockd
(
VP
10
_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
tran_low_t
*
dqcoeff
)
{
int
i
;
...
...
vp10/common/postproc.c
View file @
7da965da
...
...
@@ -612,7 +612,7 @@ void vp10_plane_add_noise_c(uint8_t *start, char *noise,
}
}
static
void
swap_mi_and_prev_mi
(
VP
9
_COMMON
*
cm
)
{
static
void
swap_mi_and_prev_mi
(
VP
10
_COMMON
*
cm
)
{
// Current mip will be the prev_mip for the next frame.
MODE_INFO
*
temp
=
cm
->
postproc_state
.
prev_mip
;
cm
->
postproc_state
.
prev_mip
=
cm
->
mip
;
...
...
vp10/common/pred_common.c
View file @
7da965da
...
...
@@ -61,7 +61,7 @@ int vp10_get_intra_inter_context(const MACROBLOCKD *xd) {
}
}
int
vp10_get_reference_mode_context
(
const
VP
9
_COMMON
*
cm
,
int
vp10_get_reference_mode_context
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
int
ctx
;
const
MB_MODE_INFO
*
const
above_mbmi
=
xd
->
above_mbmi
;
...
...
@@ -104,7 +104,7 @@ int vp10_get_reference_mode_context(const VP9_COMMON *cm,
}
// Returns a context number for the given MB prediction signal
int
vp10_get_pred_context_comp_ref_p
(
const
VP
9
_COMMON
*
cm
,
int
vp10_get_pred_context_comp_ref_p
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
int
pred_context
;
const
MB_MODE_INFO
*
const
above_mbmi
=
xd
->
above_mbmi
;
...
...
vp10/common/pred_common.h
View file @
7da965da
...
...
@@ -18,7 +18,7 @@
extern
"C"
{
#endif
static
INLINE
int
get_segment_id
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
int
get_segment_id
(
const
VP
10
_COMMON
*
cm
,
const
uint8_t
*
segment_ids
,
BLOCK_SIZE
bsize
,
int
mi_row
,
int
mi_col
)
{
const
int
mi_offset
=
mi_row
*
cm
->
mi_cols
+
mi_col
;
...
...
@@ -60,7 +60,7 @@ static INLINE int vp10_get_skip_context(const MACROBLOCKD *xd) {
return
above_skip
+
left_skip
;
}
static
INLINE
vpx_prob
vp10_get_skip_prob
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_skip_prob
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
skip_probs
[
vp10_get_skip_context
(
xd
)];
}
...
...
@@ -69,22 +69,23 @@ int vp10_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
int
vp10_get_intra_inter_context
(
const
MACROBLOCKD
*
xd
);
static
INLINE
vpx_prob
vp10_get_intra_inter_prob
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_intra_inter_prob
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
intra_inter_prob
[
vp10_get_intra_inter_context
(
xd
)];
}
int
vp10_get_reference_mode_context
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
int
vp10_get_reference_mode_context
(
const
VP10_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
static
INLINE
vpx_prob
vp10_get_reference_mode_prob
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_reference_mode_prob
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
comp_inter_prob
[
vp10_get_reference_mode_context
(
cm
,
xd
)];
}
int
vp10_get_pred_context_comp_ref_p
(
const
VP
9
_COMMON
*
cm
,
int
vp10_get_pred_context_comp_ref_p
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
static
INLINE
vpx_prob
vp10_get_pred_prob_comp_ref_p
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_pred_prob_comp_ref_p
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
const
int
pred_context
=
vp10_get_pred_context_comp_ref_p
(
cm
,
xd
);
return
cm
->
fc
->
comp_ref_prob
[
pred_context
];
...
...
@@ -92,14 +93,14 @@ static INLINE vpx_prob vp10_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
int
vp10_get_pred_context_single_ref_p1
(
const
MACROBLOCKD
*
xd
);
static
INLINE
vpx_prob
vp10_get_pred_prob_single_ref_p1
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_pred_prob_single_ref_p1
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
single_ref_prob
[
vp10_get_pred_context_single_ref_p1
(
xd
)][
0
];
}
int
vp10_get_pred_context_single_ref_p2
(
const
MACROBLOCKD
*
xd
);
static
INLINE
vpx_prob
vp10_get_pred_prob_single_ref_p2
(
const
VP
9
_COMMON
*
cm
,
static
INLINE
vpx_prob
vp10_get_pred_prob_single_ref_p2
(
const
VP
10
_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
single_ref_prob
[
vp10_get_pred_context_single_ref_p2
(
xd
)][
1
];
}
...
...
vp10/common/thread_common.c
View file @
7da965da
...
...
@@ -88,7 +88,7 @@ static INLINE void sync_write(VP9LfSync *const lf_sync, int r, int c,
// Implement row loopfiltering for each thread.
static
INLINE
void
thread_loop_filter_rows
(
const
YV12_BUFFER_CONFIG
*
const
frame_buffer
,
VP
9
_COMMON
*
const
cm
,
VP
10
_COMMON
*
const
cm
,
struct
macroblockd_plane
planes
[
MAX_MB_PLANE
],
int
start
,
int
stop
,
int
y_only
,
VP9LfSync
*
const
lf_sync
)
{
...
...
@@ -154,7 +154,7 @@ static int loop_filter_row_worker(VP9LfSync *const lf_sync,
}
static
void
loop_filter_rows_mt
(
YV12_BUFFER_CONFIG
*
frame
,
VP
9
_COMMON
*
cm
,
VP
10
_COMMON
*
cm
,
struct
macroblockd_plane
planes
[
MAX_MB_PLANE
],
int
start
,
int
stop
,
int
y_only
,
VPxWorker
*
workers
,
int
nworkers
,
...
...
@@ -214,7 +214,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame,
}
void
vp10_loop_filter_frame_mt
(
YV12_BUFFER_CONFIG
*
frame
,
VP
9
_COMMON
*
cm
,
VP
10
_COMMON
*
cm
,
struct
macroblockd_plane
planes
[
MAX_MB_PLANE
],
int
frame_filter_level
,
int
y_only
,
int
partial_frame
,
...
...
@@ -253,7 +253,7 @@ static INLINE int get_sync_range(int width) {
}
// Allocate memory for lf row synchronization
void
vp10_loop_filter_alloc
(
VP9LfSync
*
lf_sync
,
VP
9
_COMMON
*
cm
,
int
rows
,
void
vp10_loop_filter_alloc
(
VP9LfSync
*
lf_sync
,
VP
10
_COMMON
*
cm
,
int
rows
,
int
width
,
int
num_workers
)
{
lf_sync
->
rows
=
rows
;
#if CONFIG_MULTITHREAD
...
...
@@ -317,7 +317,7 @@ void vp10_loop_filter_dealloc(VP9LfSync *lf_sync) {
}
// Accumulate frame counts.
void
vp10_accumulate_frame_counts
(
VP
9
_COMMON
*
cm
,
FRAME_COUNTS
*
counts
,
void
vp10_accumulate_frame_counts
(
VP
10
_COMMON
*
cm
,
FRAME_COUNTS
*
counts
,
int
is_dec
)
{
int
i
,
j
,
k
,
l
,
m
;
...
...
vp10/common/tile_common.c
View file @
7da965da
...
...
@@ -21,17 +21,17 @@ static int get_tile_offset(int idx, int mis, int log2) {
return
MIN
(
offset
,
mis
);
}
void
vp10_tile_set_row
(
TileInfo
*
tile
,
const
VP
9
_COMMON
*
cm
,
int
row
)
{
void
vp10_tile_set_row
(
TileInfo
*
tile
,
const
VP
10
_COMMON
*
cm
,
int
row
)
{
tile
->
mi_row_start
=
get_tile_offset
(
row
,
cm
->
mi_rows
,
cm
->
log2_tile_rows
);
tile
->
mi_row_end
=
get_tile_offset
(
row
+
1
,
cm
->
mi_rows
,
cm
->
log2_tile_rows
);
}
void
vp10_tile_set_col
(
TileInfo
*
tile
,
const
VP
9
_COMMON
*
cm
,
int
col
)
{
void
vp10_tile_set_col
(
TileInfo
*
tile
,
const
VP
10
_COMMON
*
cm
,
int
col
)
{
tile
->
mi_col_start
=
get_tile_offset
(
col
,
cm
->
mi_cols
,
cm
->
log2_tile_cols
);
tile
->
mi_col_end
=
get_tile_offset
(
col
+
1
,
cm
->
mi_cols
,
cm
->
log2_tile_cols
);
}
void
vp10_tile_init
(
TileInfo
*
tile
,
const
VP
9
_COMMON
*
cm
,
int
row
,
int
col
)
{
void
vp10_tile_init
(
TileInfo
*
tile
,
const
VP
10
_COMMON
*
cm
,
int
row
,
int
col
)
{
vp10_tile_set_row
(
tile
,
cm
,
row
);
vp10_tile_set_col
(
tile
,
cm
,
col
);
}
...
...
vp10/decoder/decodeframe.c
View file @
7da965da
...
...
@@ -44,7 +44,7 @@
#define MAX_VP9_HEADER_SIZE 80
static
int
is_compound_reference_allowed
(
const
VP
9
_COMMON
*
cm
)
{
static
int
is_compound_reference_allowed
(
const
VP
10
_COMMON
*
cm
)
{
int
i
;
for
(
i
=
1
;
i
<
REFS_PER_FRAME
;
++
i
)
if
(
cm
->
ref_frame_sign_bias
[
i
+
1
]
!=
cm
->
ref_frame_sign_bias
[
1
])
...
...
@@ -53,7 +53,7 @@ static int is_compound_reference_allowed(const VP9_COMMON *cm) {
return
0
;
}
static
void
setup_compound_reference_mode
(
VP
9
_COMMON
*
cm
)
{
static
void
setup_compound_reference_mode
(
VP
10
_COMMON
*
cm
)
{
if
(
cm
->
ref_frame_sign_bias
[
LAST_FRAME
]
==
cm
->
ref_frame_sign_bias
[
GOLDEN_FRAME
])
{
cm
->
comp_fixed_ref
=
ALTREF_FRAME
;
...
...
@@ -117,7 +117,7 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
vp10_diff_update_prob
(
r
,
&
fc
->
inter_mode_probs
[
i
][
j
]);
}
static
REFERENCE_MODE
read_frame_reference_mode
(
const
VP
9
_COMMON
*
cm
,
static
REFERENCE_MODE
read_frame_reference_mode
(
const
VP
10
_COMMON
*
cm
,
vpx_reader
*
r
)
{
if
(
is_compound_reference_allowed
(
cm
))
{
return
vpx_read_bit
(
r
)
?
(
vpx_read_bit
(
r
)
?
REFERENCE_MODE_SELECT
...
...
@@ -128,7 +128,7 @@ static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
}
}
static
void
read_frame_reference_mode_probs
(
VP
9
_COMMON
*
cm
,
vpx_reader
*
r
)
{
static
void
read_frame_reference_mode_probs
(
VP
10
_COMMON
*
cm
,
vpx_reader
*
r
)
{
FRAME_CONTEXT
*
const
fc
=
cm
->
fc
;
int
i
;
...
...
@@ -781,7 +781,7 @@ static void set_plane_n4(MACROBLOCKD *const xd, int bw, int bh, int bwl,
}
}
static
MB_MODE_INFO
*
set_offsets
(
VP
9
_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
static
MB_MODE_INFO
*
set_offsets
(
VP
10
_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
BLOCK_SIZE
bsize
,
int
mi_row
,
int
mi_col
,
int
bw
,
int
bh
,
int
x_mis
,
int
y_mis
,
int
bwl
,
int
bhl
)
{
...
...
@@ -815,7 +815,7 @@ static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
int
mi_row
,
int
mi_col
,
vpx_reader
*
r
,
BLOCK_SIZE
bsize
,
int
bwl
,
int
bhl
)
{
VP
9
_COMMON
*
const
cm
=
&
pbi
->
common
;
VP
10
_COMMON
*
const
cm
=
&
pbi
->
common
;
const
int
less8x8
=
bsize
<
BLOCK_8X8
;
const
int
bw
=
1
<<
(
bwl
-
1
);
const
int
bh
=
1
<<
(
bhl
-
1
);
...
...
@@ -950,7 +950,7 @@ static PARTITION_TYPE read_partition(MACROBLOCKD *xd, int mi_row, int mi_col,
static
void
decode_partition
(
VP9Decoder
*
const
pbi
,
MACROBLOCKD
*
const
xd
,
int
mi_row
,
int
mi_col
,
vpx_reader
*
r
,
BLOCK_SIZE
bsize
,
int
n4x4_l2
)
{
VP
9
_COMMON
*
const
cm
=
&
pbi
->
common
;
VP
10
_COMMON
*
const
cm
=
&
pbi
->
common
;
const
int
n8x8_l2
=
n4x4_l2
-
1
;
const
int
num_8x8_wh
=
1
<<
n8x8_l2
;
const
int
hbs
=
num_8x8_wh
>>
1
;
...
...
@@ -1127,7 +1127,7 @@ static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) {
return
vpx_rb_read_bit
(
rb
)
?
vpx_rb_read_signed_literal
(
rb
,
4
)
:
0
;
}
static
void
setup_quantization
(
VP
9
_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
static
void
setup_quantization
(
VP
10
_COMMON
*
const
cm
,
MACROBLOCKD
*
const
xd
,
struct
vpx_read_bit_buffer
*
rb
)
{
cm
->
base_qindex
=
vpx_rb_read_literal
(
rb
,
QINDEX_BITS
);
cm
->
y_dc_delta_q
=
read_delta_q
(
rb
);
...
...
@@ -1144,7 +1144,7 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
#endif
}
static
void
setup_segmentation_dequant
(
VP
9
_COMMON
*
const
cm
)
{
static
void
setup_segmentation_dequant
(
VP
10
_COMMON
*
const
cm
)
{
// Build y/uv dequant values based on segmentation.
if
(
cm
->
seg
.
enabled
)
{
int
i
;
...
...
@@ -1180,14 +1180,15 @@ static INTERP_FILTER read_interp_filter(struct vpx_read_bit_buffer *rb) {
:
literal_to_filter
[
vpx_rb_read_literal
(
rb
,
2
)];
}
static
void
setup_display_size
(
VP9_COMMON
*
cm
,
struct
vpx_read_bit_buffer
*
rb
)
{
static
void
setup_display_size
(
VP10_COMMON
*
cm
,
struct
vpx_read_bit_buffer
*
rb
)
{
cm
->
display_width
=
cm
->
width
;
cm
->
display_height
=
cm
->
height
;
if
(
vpx_rb_read_bit
(
rb
))
vp10_read_frame_size
(
rb
,
&
cm
->
display_width
,
&
cm
->
display_height
);
}
static
void
resize_mv_buffer
(
VP
9
_COMMON
*
cm
)
{
static
void
resize_mv_buffer
(
VP
10
_COMMON
*
cm
)
{
vpx_free
(
cm
->
cur_frame
->
mvs
);
cm
->
cur_frame
->
mi_rows
=
cm
->
mi_rows
;
cm
->
cur_frame
->
mi_cols
=
cm
->
mi_cols
;
...
...
@@ -1195,7 +1196,7 @@ static void resize_mv_buffer(VP9_COMMON *cm) {
sizeof
(
*
cm
->
cur_frame
->
mvs
));
}