Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
26a9afc3
Commit
26a9afc3
authored
Aug 13, 2015
by
Yaowu Xu
Browse files
VP9_COMP -> VP10_COMP
Change-Id: I83b5c69621f9f28b742e5b13517d4e5b99c6cd26
parent
fc7cbd1f
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
vp10/encoder/aq_complexity.c
View file @
26a9afc3
...
...
@@ -43,7 +43,7 @@ static int get_aq_c_strength(int q_index, vpx_bit_depth_t bit_depth) {
return
(
base_quant
>
10
)
+
(
base_quant
>
25
);
}
void
vp10_setup_in_frame_q_adj
(
VP
9
_COMP
*
cpi
)
{
void
vp10_setup_in_frame_q_adj
(
VP
10
_COMP
*
cpi
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
struct
segmentation
*
const
seg
=
&
cm
->
seg
;
...
...
@@ -110,7 +110,7 @@ void vp10_setup_in_frame_q_adj(VP9_COMP *cpi) {
// Select a segment for the current block.
// The choice of segment for a block depends on the ratio of the projected
// bits for the block vs a target average and its spatial complexity.
void
vp10_caq_select_segment
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
mb
,
BLOCK_SIZE
bs
,
void
vp10_caq_select_segment
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
mb
,
BLOCK_SIZE
bs
,
int
mi_row
,
int
mi_col
,
int
projected_rate
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
...
...
vp10/encoder/aq_complexity.h
View file @
26a9afc3
...
...
@@ -18,17 +18,17 @@ extern "C" {
#include "vp10/common/enums.h"
struct
VP
9
_COMP
;
struct
VP
10
_COMP
;
struct
macroblock
;
// Select a segment for the current Block.
void
vp10_caq_select_segment
(
struct
VP
9
_COMP
*
cpi
,
struct
macroblock
*
,
void
vp10_caq_select_segment
(
struct
VP
10
_COMP
*
cpi
,
struct
macroblock
*
,
BLOCK_SIZE
bs
,
int
mi_row
,
int
mi_col
,
int
projected_rate
);
// This function sets up a set of segments with delta Q values around
// the baseline frame quantizer.
void
vp10_setup_in_frame_q_adj
(
struct
VP
9
_COMP
*
cpi
);
void
vp10_setup_in_frame_q_adj
(
struct
VP
10
_COMP
*
cpi
);
#ifdef __cplusplus
}
// extern "C"
...
...
vp10/encoder/aq_cyclicrefresh.c
View file @
26a9afc3
...
...
@@ -137,7 +137,7 @@ static int candidate_refresh_aq(const CYCLIC_REFRESH *cr,
}
// Compute delta-q for the segment.
static
int
compute_deltaq
(
const
VP
9
_COMP
*
cpi
,
int
q
,
double
rate_factor
)
{
static
int
compute_deltaq
(
const
VP
10
_COMP
*
cpi
,
int
q
,
double
rate_factor
)
{
const
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
int
deltaq
=
vp10_compute_qdelta_by_rate
(
rc
,
cpi
->
common
.
frame_type
,
...
...
@@ -153,7 +153,7 @@ static int compute_deltaq(const VP9_COMP *cpi, int q, double rate_factor) {
// from non-base segment. For now ignore effect of multiple segments
// (with different delta-q). Note this function is called in the postencode
// (called from rc_update_rate_correction_factors()).
int
vp10_cyclic_refresh_estimate_bits_at_q
(
const
VP
9
_COMP
*
cpi
,
int
vp10_cyclic_refresh_estimate_bits_at_q
(
const
VP
10
_COMP
*
cpi
,
double
correction_factor
)
{
const
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
const
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
...
...
@@ -184,7 +184,7 @@ int vp10_cyclic_refresh_estimate_bits_at_q(const VP9_COMP *cpi,
// rc_regulate_q() to set the base qp index.
// Note: the segment map is set to either 0/CR_SEGMENT_ID_BASE (no refresh) or
// to 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock, prior to encoding.
int
vp10_cyclic_refresh_rc_bits_per_mb
(
const
VP
9
_COMP
*
cpi
,
int
i
,
int
vp10_cyclic_refresh_rc_bits_per_mb
(
const
VP
10
_COMP
*
cpi
,
int
i
,
double
correction_factor
)
{
const
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
...
...
@@ -209,7 +209,7 @@ int vp10_cyclic_refresh_rc_bits_per_mb(const VP9_COMP *cpi, int i,
// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col),
// check if we should reset the segment_id, and update the cyclic_refresh map
// and segmentation map.
void
vp10_cyclic_refresh_update_segment
(
VP
9
_COMP
*
const
cpi
,
void
vp10_cyclic_refresh_update_segment
(
VP
10
_COMP
*
const
cpi
,
MB_MODE_INFO
*
const
mbmi
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
...
...
@@ -273,7 +273,7 @@ void vp10_cyclic_refresh_update_segment(VP9_COMP *const cpi,
}
// Update the actual number of blocks that were applied the segment delta q.
void
vp10_cyclic_refresh_postencode
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_postencode
(
VP
10
_COMP
*
const
cpi
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
unsigned
char
*
const
seg_map
=
cpi
->
segmentation_map
;
...
...
@@ -292,7 +292,7 @@ void vp10_cyclic_refresh_postencode(VP9_COMP *const cpi) {
}
// Set golden frame update interval, for non-svc 1 pass CBR mode.
void
vp10_cyclic_refresh_set_golden_update
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_set_golden_update
(
VP
10
_COMP
*
const
cpi
)
{
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
// Set minimum gf_interval for GF update to a multiple (== 2) of refresh
...
...
@@ -308,7 +308,7 @@ void vp10_cyclic_refresh_set_golden_update(VP9_COMP *const cpi) {
// background has high motion, refresh the golden frame. Otherwise, if the
// golden reference is to be updated check if we should NOT update the golden
// ref.
void
vp10_cyclic_refresh_check_golden_update
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_check_golden_update
(
VP
10
_COMP
*
const
cpi
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
int
mi_row
,
mi_col
;
...
...
@@ -380,7 +380,7 @@ void vp10_cyclic_refresh_check_golden_update(VP9_COMP *const cpi) {
// 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock.
// Blocks labeled as BOOST1 may later get set to BOOST2 (during the
// encoding of the superblock).
static
void
cyclic_refresh_update_map
(
VP
9
_COMP
*
const
cpi
)
{
static
void
cyclic_refresh_update_map
(
VP
10
_COMP
*
const
cpi
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
unsigned
char
*
const
seg_map
=
cpi
->
segmentation_map
;
...
...
@@ -449,7 +449,7 @@ static void cyclic_refresh_update_map(VP9_COMP *const cpi) {
}
// Set cyclic refresh parameters.
void
vp10_cyclic_refresh_update_parameters
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_update_parameters
(
VP
10
_COMP
*
const
cpi
)
{
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
...
...
@@ -475,7 +475,7 @@ void vp10_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
}
// Setup cyclic background refresh: set delta q and segmentation map.
void
vp10_cyclic_refresh_setup
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_setup
(
VP
10
_COMP
*
const
cpi
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
...
...
@@ -559,7 +559,7 @@ int vp10_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr) {
return
cr
->
rdmult
;
}
void
vp10_cyclic_refresh_reset_resize
(
VP
9
_COMP
*
const
cpi
)
{
void
vp10_cyclic_refresh_reset_resize
(
VP
10
_COMP
*
const
cpi
)
{
const
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
memset
(
cr
->
map
,
0
,
cm
->
mi_rows
*
cm
->
mi_cols
);
...
...
vp10/encoder/aq_cyclicrefresh.h
View file @
26a9afc3
...
...
@@ -27,7 +27,7 @@ extern "C" {
// Maximum rate target ratio for setting segment delta-qp.
#define CR_MAX_RATE_TARGET_RATIO 4.0
struct
VP
9
_COMP
;
struct
VP
10
_COMP
;
struct
CYCLIC_REFRESH
;
typedef
struct
CYCLIC_REFRESH
CYCLIC_REFRESH
;
...
...
@@ -38,44 +38,44 @@ void vp10_cyclic_refresh_free(CYCLIC_REFRESH *cr);
// Estimate the bits, incorporating the delta-q from segment 1, after encoding
// the frame.
int
vp10_cyclic_refresh_estimate_bits_at_q
(
const
struct
VP
9
_COMP
*
cpi
,
int
vp10_cyclic_refresh_estimate_bits_at_q
(
const
struct
VP
10
_COMP
*
cpi
,
double
correction_factor
);
// Estimate the bits per mb, for a given q = i and a corresponding delta-q
// (for segment 1), prior to encoding the frame.
int
vp10_cyclic_refresh_rc_bits_per_mb
(
const
struct
VP
9
_COMP
*
cpi
,
int
i
,
int
vp10_cyclic_refresh_rc_bits_per_mb
(
const
struct
VP
10
_COMP
*
cpi
,
int
i
,
double
correction_factor
);
// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col),
// check if we should reset the segment_id, and update the cyclic_refresh map
// and segmentation map.
void
vp10_cyclic_refresh_update_segment
(
struct
VP
9
_COMP
*
const
cpi
,
void
vp10_cyclic_refresh_update_segment
(
struct
VP
10
_COMP
*
const
cpi
,
MB_MODE_INFO
*
const
mbmi
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
int64_t
rate
,
int64_t
dist
,
int
skip
);
// Update the segmentation map, and related quantities: cyclic refresh map,
// refresh sb_index, and target number of blocks to be refreshed.
void
vp10_cyclic_refresh_update__map
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_update__map
(
struct
VP
10
_COMP
*
const
cpi
);
// Update the actual number of blocks that were applied the segment delta q.
void
vp10_cyclic_refresh_postencode
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_postencode
(
struct
VP
10
_COMP
*
const
cpi
);
// Set golden frame update interval, for non-svc 1 pass CBR mode.
void
vp10_cyclic_refresh_set_golden_update
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_set_golden_update
(
struct
VP
10
_COMP
*
const
cpi
);
// Check if we should not update golden reference, based on past refresh stats.
void
vp10_cyclic_refresh_check_golden_update
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_check_golden_update
(
struct
VP
10
_COMP
*
const
cpi
);
// Set/update global/frame level refresh parameters.
void
vp10_cyclic_refresh_update_parameters
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_update_parameters
(
struct
VP
10
_COMP
*
const
cpi
);
// Setup cyclic background refresh: set delta q and segmentation map.
void
vp10_cyclic_refresh_setup
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_setup
(
struct
VP
10
_COMP
*
const
cpi
);
int
vp10_cyclic_refresh_get_rdmult
(
const
CYCLIC_REFRESH
*
cr
);
void
vp10_cyclic_refresh_reset_resize
(
struct
VP
9
_COMP
*
const
cpi
);
void
vp10_cyclic_refresh_reset_resize
(
struct
VP
10
_COMP
*
const
cpi
);
static
INLINE
int
cyclic_refresh_segment_id_boosted
(
int
segment_id
)
{
return
segment_id
==
CR_SEGMENT_ID_BOOST1
||
...
...
vp10/encoder/aq_variance.c
View file @
26a9afc3
...
...
@@ -42,7 +42,7 @@ unsigned int vp10_vaq_segment_id(int energy) {
return
SEGMENT_ID
(
energy
);
}
void
vp10_vaq_frame_setup
(
VP
9
_COMP
*
cpi
)
{
void
vp10_vaq_frame_setup
(
VP
10
_COMP
*
cpi
)
{
VP10_COMMON
*
cm
=
&
cpi
->
common
;
struct
segmentation
*
seg
=
&
cm
->
seg
;
int
i
;
...
...
@@ -137,7 +137,7 @@ static void aq_highbd_8_variance(const uint8_t *a8, int a_stride,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
static
unsigned
int
block_variance
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
x
,
static
unsigned
int
block_variance
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
)
{
MACROBLOCKD
*
xd
=
&
x
->
e_mbd
;
unsigned
int
var
,
sse
;
...
...
@@ -188,14 +188,14 @@ static unsigned int block_variance(VP9_COMP *cpi, MACROBLOCK *x,
}
}
double
vp10_log_block_var
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
)
{
double
vp10_log_block_var
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
)
{
unsigned
int
var
=
block_variance
(
cpi
,
x
,
bs
);
vpx_clear_system_state
();
return
log
(
var
+
1
.
0
);
}
#define DEFAULT_E_MIDPOINT 10.0
int
vp10_block_energy
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
)
{
int
vp10_block_energy
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
)
{
double
energy
;
double
energy_midpoint
;
vpx_clear_system_state
();
...
...
vp10/encoder/aq_variance.h
View file @
26a9afc3
...
...
@@ -19,10 +19,10 @@ extern "C" {
#endif
unsigned
int
vp10_vaq_segment_id
(
int
energy
);
void
vp10_vaq_frame_setup
(
VP
9
_COMP
*
cpi
);
void
vp10_vaq_frame_setup
(
VP
10
_COMP
*
cpi
);
int
vp10_block_energy
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
);
double
vp10_log_block_var
(
VP
9
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
);
int
vp10_block_energy
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
);
double
vp10_log_block_var
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bs
);
#ifdef __cplusplus
}
// extern "C"
...
...
vp10/encoder/bitstream.c
View file @
26a9afc3
...
...
@@ -234,7 +234,7 @@ static void write_ref_frames(const VP10_COMMON *cm, const MACROBLOCKD *xd,
}
}
static
void
pack_inter_mode_mvs
(
VP
9
_COMP
*
cpi
,
const
MODE_INFO
*
mi
,
static
void
pack_inter_mode_mvs
(
VP
10
_COMP
*
cpi
,
const
MODE_INFO
*
mi
,
vpx_writer
*
w
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
const
nmv_context
*
nmvc
=
&
cm
->
fc
->
nmvc
;
...
...
@@ -374,7 +374,7 @@ static void write_mb_modes_kf(const VP10_COMMON *cm, const MACROBLOCKD *xd,
write_intra_mode
(
w
,
mbmi
->
uv_mode
,
vp10_kf_uv_mode_prob
[
mbmi
->
mode
]);
}
static
void
write_modes_b
(
VP
9
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
static
void
write_modes_b
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
vpx_writer
*
w
,
TOKENEXTRA
**
tok
,
const
TOKENEXTRA
*
const
tok_end
,
int
mi_row
,
int
mi_col
)
{
...
...
@@ -424,7 +424,7 @@ static void write_partition(const VP10_COMMON *const cm,
}
}
static
void
write_modes_sb
(
VP
9
_COMP
*
cpi
,
static
void
write_modes_sb
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
vpx_writer
*
w
,
TOKENEXTRA
**
tok
,
const
TOKENEXTRA
*
const
tok_end
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
)
{
...
...
@@ -482,7 +482,7 @@ static void write_modes_sb(VP9_COMP *cpi,
update_partition_context
(
xd
,
mi_row
,
mi_col
,
subsize
,
bsize
);
}
static
void
write_modes
(
VP
9
_COMP
*
cpi
,
static
void
write_modes
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
vpx_writer
*
w
,
TOKENEXTRA
**
tok
,
const
TOKENEXTRA
*
const
tok_end
)
{
const
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
...
...
@@ -501,7 +501,7 @@ static void write_modes(VP9_COMP *cpi,
}
}
static
void
build_tree_distribution
(
VP
9
_COMP
*
cpi
,
TX_SIZE
tx_size
,
static
void
build_tree_distribution
(
VP
10
_COMP
*
cpi
,
TX_SIZE
tx_size
,
vp10_coeff_stats
*
coef_branch_ct
,
vp10_coeff_probs_model
*
coef_probs
)
{
vp10_coeff_count
*
coef_counts
=
cpi
->
td
.
rd_counts
.
coef_counts
[
tx_size
];
...
...
@@ -528,7 +528,7 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size,
}
}
static
void
update_coef_probs_common
(
vpx_writer
*
const
bc
,
VP
9
_COMP
*
cpi
,
static
void
update_coef_probs_common
(
vpx_writer
*
const
bc
,
VP
10
_COMP
*
cpi
,
TX_SIZE
tx_size
,
vp10_coeff_stats
*
frame_branch_ct
,
vp10_coeff_probs_model
*
new_coef_probs
)
{
...
...
@@ -673,7 +673,7 @@ static void update_coef_probs_common(vpx_writer* const bc, VP9_COMP *cpi,
}
}
static
void
update_coef_probs
(
VP
9
_COMP
*
cpi
,
vpx_writer
*
w
)
{
static
void
update_coef_probs
(
VP
10
_COMP
*
cpi
,
vpx_writer
*
w
)
{
const
TX_MODE
tx_mode
=
cpi
->
common
.
tx_mode
;
const
TX_SIZE
max_tx_size
=
tx_mode_to_biggest_tx_size
[
tx_mode
];
TX_SIZE
tx_size
;
...
...
@@ -900,7 +900,7 @@ static void write_tile_info(const VP10_COMMON *const cm,
vpx_wb_write_bit
(
wb
,
cm
->
log2_tile_rows
!=
1
);
}
static
int
get_refresh_mask
(
VP
9
_COMP
*
cpi
)
{
static
int
get_refresh_mask
(
VP
10
_COMP
*
cpi
)
{
if
(
vp10_preserve_existing_gf
(
cpi
))
{
// We have decided to preserve the previously existing golden frame as our
// new ARF frame. However, in the short term we leave it in the GF slot and,
...
...
@@ -926,7 +926,7 @@ static int get_refresh_mask(VP9_COMP *cpi) {
}
}
static
size_t
encode_tiles
(
VP
9
_COMP
*
cpi
,
uint8_t
*
data_ptr
)
{
static
size_t
encode_tiles
(
VP
10
_COMP
*
cpi
,
uint8_t
*
data_ptr
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
vpx_writer
residual_bc
;
int
tile_row
,
tile_col
;
...
...
@@ -987,7 +987,7 @@ static void write_frame_size(const VP10_COMMON *cm,
write_display_size
(
cm
,
wb
);
}
static
void
write_frame_size_with_refs
(
VP
9
_COMP
*
cpi
,
static
void
write_frame_size_with_refs
(
VP
10
_COMP
*
cpi
,
struct
vpx_write_bit_buffer
*
wb
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
int
found
=
0
;
...
...
@@ -1074,7 +1074,7 @@ static void write_bitdepth_colorspace_sampling(
}
}
static
void
write_uncompressed_header
(
VP
9
_COMP
*
cpi
,
static
void
write_uncompressed_header
(
VP
10
_COMP
*
cpi
,
struct
vpx_write_bit_buffer
*
wb
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCKD
*
const
xd
=
&
cpi
->
td
.
mb
.
e_mbd
;
...
...
@@ -1150,7 +1150,7 @@ static void write_uncompressed_header(VP9_COMP *cpi,
write_tile_info
(
cm
,
wb
);
}
static
size_t
write_compressed_header
(
VP
9
_COMP
*
cpi
,
uint8_t
*
data
)
{
static
size_t
write_compressed_header
(
VP
10
_COMP
*
cpi
,
uint8_t
*
data
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCKD
*
const
xd
=
&
cpi
->
td
.
mb
.
e_mbd
;
FRAME_CONTEXT
*
const
fc
=
cm
->
fc
;
...
...
@@ -1227,7 +1227,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
return
header_bc
.
pos
;
}
void
vp10_pack_bitstream
(
VP
9
_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
)
{
void
vp10_pack_bitstream
(
VP
10
_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
)
{
uint8_t
*
data
=
dest
;
size_t
first_part_size
,
uncompressed_hdr_size
;
struct
vpx_write_bit_buffer
wb
=
{
data
,
0
};
...
...
vp10/encoder/bitstream.h
View file @
26a9afc3
...
...
@@ -18,9 +18,9 @@ extern "C" {
#include "vp10/encoder/encoder.h"
void
vp10_pack_bitstream
(
VP
9
_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
);
void
vp10_pack_bitstream
(
VP
10
_COMP
*
cpi
,
uint8_t
*
dest
,
size_t
*
size
);
static
INLINE
int
vp10_preserve_existing_gf
(
VP
9
_COMP
*
cpi
)
{
static
INLINE
int
vp10_preserve_existing_gf
(
VP
10
_COMP
*
cpi
)
{
return
!
cpi
->
multi_arf_allowed
&&
cpi
->
refresh_golden_frame
&&
cpi
->
rc
.
is_src_frame_alt_ref
&&
(
!
cpi
->
use_svc
||
// Add spatial svc base layer case here
...
...
vp10/encoder/context_tree.h
View file @
26a9afc3
...
...
@@ -14,7 +14,7 @@
#include "vp10/common/blockd.h"
#include "vp10/encoder/block.h"
struct
VP
9
_COMP
;
struct
VP
10
_COMP
;
struct
VP9Common
;
struct
ThreadData
;
...
...
vp10/encoder/encodeframe.c
View file @
26a9afc3
...
...
@@ -46,7 +46,7 @@
#include "vp10/encoder/segmentation.h"
#include "vp10/encoder/tokenize.h"
static
void
encode_superblock
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
encode_superblock
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
TOKENEXTRA
**
t
,
int
output_enabled
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
PICK_MODE_CONTEXT
*
ctx
);
...
...
@@ -101,7 +101,7 @@ static const uint16_t VP9_HIGH_VAR_OFFS_12[64] = {
};
#endif // CONFIG_VP9_HIGHBITDEPTH
unsigned
int
vp10_get_sby_perpixel_variance
(
VP
9
_COMP
*
cpi
,
unsigned
int
vp10_get_sby_perpixel_variance
(
VP
10
_COMP
*
cpi
,
const
struct
buf_2d
*
ref
,
BLOCK_SIZE
bs
)
{
unsigned
int
sse
;
...
...
@@ -112,7 +112,7 @@ unsigned int vp10_get_sby_perpixel_variance(VP9_COMP *cpi,
#if CONFIG_VP9_HIGHBITDEPTH
unsigned
int
vp10_high_get_sby_perpixel_variance
(
VP
9
_COMP
*
cpi
,
const
struct
buf_2d
*
ref
,
BLOCK_SIZE
bs
,
int
bd
)
{
VP
10
_COMP
*
cpi
,
const
struct
buf_2d
*
ref
,
BLOCK_SIZE
bs
,
int
bd
)
{
unsigned
int
var
,
sse
;
switch
(
bd
)
{
case
10
:
...
...
@@ -136,7 +136,7 @@ unsigned int vp10_high_get_sby_perpixel_variance(
}
#endif // CONFIG_VP9_HIGHBITDEPTH
static
unsigned
int
get_sby_perpixel_diff_variance
(
VP
9
_COMP
*
cpi
,
static
unsigned
int
get_sby_perpixel_diff_variance
(
VP
10
_COMP
*
cpi
,
const
struct
buf_2d
*
ref
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bs
)
{
...
...
@@ -151,7 +151,8 @@ static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi,
return
ROUND_POWER_OF_TWO
(
var
,
num_pels_log2_lookup
[
bs
]);
}
static
BLOCK_SIZE
get_rd_var_based_fixed_partition
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
,
static
BLOCK_SIZE
get_rd_var_based_fixed_partition
(
VP10_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
mi_row
,
int
mi_col
)
{
unsigned
int
var
=
get_sby_perpixel_diff_variance
(
cpi
,
&
x
->
plane
[
0
].
src
,
...
...
@@ -180,7 +181,7 @@ static INLINE void set_mode_info_offsets(VP10_COMMON *const cm,
x
->
mbmi_ext
=
x
->
mbmi_ext_base
+
(
mi_row
*
cm
->
mi_cols
+
mi_col
);
}
static
void
set_offsets
(
VP
9
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
static
void
set_offsets
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
MACROBLOCK
*
const
x
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
...
...
@@ -250,7 +251,7 @@ static void duplicate_mode_info_in_sb(VP10_COMMON *cm, MACROBLOCKD *xd,
}
}
static
void
set_block_size
(
VP
9
_COMP
*
const
cpi
,
static
void
set_block_size
(
VP
10
_COMP
*
const
cpi
,
MACROBLOCK
*
const
x
,
MACROBLOCKD
*
const
xd
,
int
mi_row
,
int
mi_col
,
...
...
@@ -386,7 +387,7 @@ static void fill_variance_tree(void *data, BLOCK_SIZE bsize) {
&
node
.
part_variances
->
none
);
}
static
int
set_vt_partitioning
(
VP
9
_COMP
*
cpi
,
static
int
set_vt_partitioning
(
VP
10
_COMP
*
cpi
,
MACROBLOCK
*
const
x
,
MACROBLOCKD
*
const
xd
,
void
*
data
,
...
...
@@ -476,7 +477,7 @@ static int set_vt_partitioning(VP9_COMP *cpi,
// 0 - threshold_64x64, 1 - threshold_32x32, 2 - threshold_16x16,
// 3 - vbp_threshold_8x8. vbp_threshold_8x8 (to split to 4x4 partition) is
// currently only used on key frame.
static
void
set_vbp_thresholds
(
VP
9
_COMP
*
cpi
,
int64_t
thresholds
[],
int
q
)
{
static
void
set_vbp_thresholds
(
VP
10
_COMP
*
cpi
,
int64_t
thresholds
[],
int
q
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
const
int
is_key_frame
=
(
cm
->
frame_type
==
KEY_FRAME
);
const
int
threshold_multiplier
=
is_key_frame
?
20
:
1
;
...
...
@@ -502,7 +503,7 @@ static void set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
}
}
void
vp10_set_variance_partition_thresholds
(
VP
9
_COMP
*
cpi
,
int
q
)
{
void
vp10_set_variance_partition_thresholds
(
VP
10
_COMP
*
cpi
,
int
q
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
const
int
is_key_frame
=
(
cm
->
frame_type
==
KEY_FRAME
);
...
...
@@ -649,7 +650,7 @@ static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d,
// This function chooses partitioning based on the variance between source and
// reconstructed last, where variance is computed for down-sampled inputs.
static
int
choose_partitioning
(
VP
9
_COMP
*
cpi
,
static
int
choose_partitioning
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
MACROBLOCK
*
x
,
int
mi_row
,
int
mi_col
)
{
...
...
@@ -961,7 +962,7 @@ static int choose_partitioning(VP9_COMP *cpi,
return
0
;
}
static
void
update_state
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
update_state
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
PICK_MODE_CONTEXT
*
ctx
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
int
output_enabled
)
{
...
...
@@ -1146,7 +1147,7 @@ static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode,
vp10_rd_cost_init
(
rd_cost
);
}
static
int
set_segment_rdmult
(
VP
9
_COMP
*
const
cpi
,
static
int
set_segment_rdmult
(
VP
10
_COMP
*
const
cpi
,
MACROBLOCK
*
const
x
,
int8_t
segment_id
)
{
int
segment_qindex
;
...
...
@@ -1158,7 +1159,7 @@ static int set_segment_rdmult(VP9_COMP *const cpi,
return
vp10_compute_rd_mult
(
cpi
,
segment_qindex
+
cm
->
y_dc_delta_q
);
}
static
void
rd_pick_sb_modes
(
VP
9
_COMP
*
cpi
,
static
void
rd_pick_sb_modes
(
VP
10
_COMP
*
cpi
,
TileDataEnc
*
tile_data
,
MACROBLOCK
*
const
x
,
int
mi_row
,
int
mi_col
,
RD_COST
*
rd_cost
,
...
...
@@ -1396,7 +1397,7 @@ static void save_context(MACROBLOCK *const x, int mi_row, int mi_col,
sizeof
(
xd
->
left_seg_context
[
0
])
*
mi_height
);
}
static
void
encode_b
(
VP
9
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
static
void
encode_b
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
ThreadData
*
td
,
TOKENEXTRA
**
tp
,
int
mi_row
,
int
mi_col
,
int
output_enabled
,
BLOCK_SIZE
bsize
,
...
...
@@ -1414,7 +1415,7 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile,
}
}
static
void
encode_sb
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
encode_sb
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
const
TileInfo
*
const
tile
,
TOKENEXTRA
**
tp
,
int
mi_row
,
int
mi_col
,
int
output_enabled
,
BLOCK_SIZE
bsize
,
...
...
@@ -1529,7 +1530,7 @@ static void set_partial_b64x64_partition(MODE_INFO *mi, int mis,
// However, at the bottom and right borders of the image the requested size
// may not be allowed in which case this code attempts to choose the largest
// allowable partition.
static
void
set_fixed_partitioning
(
VP
9
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
static
void
set_fixed_partitioning
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
MODE_INFO
**
mi_8x8
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
...
...
@@ -1574,7 +1575,7 @@ static const struct {
{
4
,
4
},
{
4
,
6
},
{
6
,
4
},
{
6
,
6
},
};
static
void
set_source_var_based_partition
(
VP
9
_COMP
*
cpi
,
static
void
set_source_var_based_partition
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
MACROBLOCK
*
const
x
,
MODE_INFO
**
mi_8x8
,
...
...
@@ -1660,7 +1661,7 @@ static void set_source_var_based_partition(VP9_COMP *cpi,
}
}
static
void
update_state_rt
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
update_state_rt
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
PICK_MODE_CONTEXT
*
ctx
,
int
mi_row
,
int
mi_col
,
int
bsize
)
{
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
...
...
@@ -1727,7 +1728,7 @@ static void update_state_rt(VP9_COMP *cpi, ThreadData *td,
x
->
skip_txfm
[
0
]
=
mbmi
->
segment_id
?
0
:
ctx
->
skip_txfm
[
0
];
}
static
void
encode_b_rt
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
encode_b_rt
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
const
TileInfo
*
const
tile
,
TOKENEXTRA
**
tp
,
int
mi_row
,
int
mi_col
,
int
output_enabled
,
BLOCK_SIZE
bsize
,
...
...
@@ -1751,7 +1752,7 @@ static void encode_b_rt(VP9_COMP *cpi, ThreadData *td,
(
*
tp
)
++
;
}
static
void
encode_sb_rt
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
encode_sb_rt
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
const
TileInfo
*
const
tile
,
TOKENEXTRA
**
tp
,
int
mi_row
,
int
mi_col
,
int
output_enabled
,
BLOCK_SIZE
bsize
,
...
...
@@ -1823,7 +1824,7 @@ static void encode_sb_rt(VP9_COMP *cpi, ThreadData *td,
update_partition_context
(
xd
,
mi_row
,
mi_col
,
subsize
,
bsize
);
}
static
void
rd_use_partition
(
VP
9
_COMP
*
cpi
,
static
void
rd_use_partition
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
TileDataEnc
*
tile_data
,
MODE_INFO
**
mi_8x8
,
TOKENEXTRA
**
tp
,
...
...
@@ -2150,7 +2151,7 @@ static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = {
// Look at neighboring blocks and set a min and max partition size based on
// what they chose.
static
void
rd_auto_partition_range
(
VP
9
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
static
void
rd_auto_partition_range
(
VP
10
_COMP
*
cpi
,
const
TileInfo
*
const
tile
,
MACROBLOCKD
*
const
xd
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
*
min_block_size
,
...
...
@@ -2336,7 +2337,7 @@ static INLINE int get_motion_inconsistency(MOTION_DIRECTION this_mv,
// TODO(jingning,jimbankoski,rbultje): properly skip partition types that are
// unlikely to be selected depending on previous rate-distortion optimization
// results, for encoding speed-up.
static
void
rd_pick_partition
(
VP
9
_COMP
*
cpi
,
ThreadData
*
td
,
static
void
rd_pick_partition
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
TileDataEnc
*
tile_data
,
TOKENEXTRA
**
tp
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
RD_COST
*
rd_cost
,
...
...
@@ -2749,7 +2750,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td,
}
}
static
void
encode_rd_sb_row
(
VP
9
_COMP
*
cpi
,
static
void
encode_rd_sb_row
(
VP
10
_COMP
*
cpi
,
ThreadData
*
td
,
TileDataEnc
*
tile_data
,
int
mi_row
,
...
...
@@ -2834,7 +2835,7 @@ static void encode_rd_sb_row(VP9_COMP *cpi,
}
}
static
void
init_encode_frame_mb_context
(
VP
9
_COMP
*
cpi
)
{
static
void
init_encode_frame_mb_context
(
VP
10
_COMP
*
cpi
)
{
MACROBLOCK
*
const
x
=
&
cpi
->
td
.
mb
;
VP10_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
...
...
@@ -2854,7 +2855,7 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
sizeof
(
*
xd
->
above_seg_context
)
*
aligned_mi_cols
);
}