Merge changes from topic "clang-format"
* changes: clang-format v5.0.0 vp9/ remove spurious comments clang-format v5.0.0 vp8/ clang-format v5.0.0 vpx_dsp/ clang-format v5.0.0 mem_ops.h clang-format v5.0.0 vpx_util/vpx_atomic.h clang-format v5.0.0 y4minput.c clang-format v5.0.0 vpxenc.c clang-format v5.0.0 examples/ clang-format v5.0.0 test/
This commit is contained in:
commit
3761254119
@ -429,8 +429,9 @@ static void set_rate_control_stats(struct RateControlStats *rc,
|
||||
rc->layer_framerate[layer] = framerate / cfg->ts_rate_decimator[tl];
|
||||
if (tl > 0) {
|
||||
rc->layer_pfb[layer] =
|
||||
1000.0 * (cfg->layer_target_bitrate[layer] -
|
||||
cfg->layer_target_bitrate[layer - 1]) /
|
||||
1000.0 *
|
||||
(cfg->layer_target_bitrate[layer] -
|
||||
cfg->layer_target_bitrate[layer - 1]) /
|
||||
(rc->layer_framerate[layer] - rc->layer_framerate[layer - 1]);
|
||||
} else {
|
||||
rc->layer_pfb[layer] = 1000.0 * cfg->layer_target_bitrate[layer] /
|
||||
|
@ -99,9 +99,10 @@ static void set_rate_control_metrics(struct RateControlMetrics *rc,
|
||||
for (i = 0; i < cfg->ts_number_layers; ++i) {
|
||||
if (i > 0) {
|
||||
rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i];
|
||||
rc->layer_pfb[i] = 1000.0 * (rc->layer_target_bitrate[i] -
|
||||
rc->layer_target_bitrate[i - 1]) /
|
||||
(rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
|
||||
rc->layer_pfb[i] =
|
||||
1000.0 *
|
||||
(rc->layer_target_bitrate[i] - rc->layer_target_bitrate[i - 1]) /
|
||||
(rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
|
||||
}
|
||||
rc->layer_input_frames[i] = 0;
|
||||
rc->layer_enc_frames[i] = 0;
|
||||
|
@ -215,7 +215,7 @@ using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_ENCODER
|
||||
const BlockinessParam c_vp9_tests[] = {
|
||||
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238),
|
||||
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238)
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests));
|
||||
#endif
|
||||
|
@ -205,7 +205,7 @@ using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_ENCODER
|
||||
const ConsistencyParam c_vp9_tests[] = {
|
||||
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238),
|
||||
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238)
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(C, ConsistencyVP9Test,
|
||||
::testing::ValuesIn(c_vp9_tests));
|
||||
|
@ -112,8 +112,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(MSA, SumSquaresTest, ::testing::Values(make_tuple(
|
||||
&vpx_sum_squares_2d_i16_c,
|
||||
&vpx_sum_squares_2d_i16_msa)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, SumSquaresTest,
|
||||
::testing::Values(make_tuple(&vpx_sum_squares_2d_i16_c,
|
||||
&vpx_sum_squares_2d_i16_msa)));
|
||||
#endif // HAVE_MSA
|
||||
} // namespace
|
||||
|
@ -61,7 +61,6 @@ int main(int argc, char **argv) {
|
||||
#if !CONFIG_SHARED
|
||||
// Shared library builds don't support whitebox tests
|
||||
// that exercise internal symbols.
|
||||
|
||||
#if CONFIG_VP8
|
||||
vp8_rtcd();
|
||||
#endif // CONFIG_VP8
|
||||
|
@ -59,7 +59,7 @@ const TestVideoParam kTestVectors[] = {
|
||||
// Encoding modes tested
|
||||
const libvpx_test::TestMode kEncodingModeVectors[] = {
|
||||
::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kRealTime,
|
||||
::libvpx_test::kRealTime
|
||||
};
|
||||
|
||||
// Speed settings tested
|
||||
|
@ -22,7 +22,7 @@ namespace {
|
||||
// Encoding modes
|
||||
const libvpx_test::TestMode kEncodingModeVectors[] = {
|
||||
::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kRealTime,
|
||||
::libvpx_test::kRealTime
|
||||
};
|
||||
|
||||
// Encoding speeds
|
||||
|
@ -147,7 +147,6 @@ TEST(VPxWorkerThreadTest, TestInterfaceAPI) {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Multi-threaded decode tests
|
||||
|
||||
#if CONFIG_WEBM_IO
|
||||
struct FileList {
|
||||
const char *name;
|
||||
|
@ -37,7 +37,9 @@ extern "C" {
|
||||
#define SEGMENT_DELTADATA 0
|
||||
#define SEGMENT_ABSDATA 1
|
||||
|
||||
typedef struct { int r, c; } POS;
|
||||
typedef struct {
|
||||
int r, c;
|
||||
} POS;
|
||||
|
||||
#define PLANE_TYPE_Y_NO_DC 0
|
||||
#define PLANE_TYPE_Y2 1
|
||||
|
@ -20,8 +20,7 @@ static void copy_and_extend_plane(unsigned char *s, /* source */
|
||||
int et, /* extend top border */
|
||||
int el, /* extend left border */
|
||||
int eb, /* extend bottom border */
|
||||
int er /* extend right border */
|
||||
) {
|
||||
int er) { /* extend right border */
|
||||
int i;
|
||||
unsigned char *src_ptr1, *src_ptr2;
|
||||
unsigned char *dest_ptr1, *dest_ptr2;
|
||||
|
@ -11,28 +11,16 @@
|
||||
#include "entropy.h"
|
||||
|
||||
const int vp8_mode_contexts[6][4] = {
|
||||
{
|
||||
/* 0 */
|
||||
7, 1, 1, 143,
|
||||
},
|
||||
{
|
||||
/* 1 */
|
||||
14, 18, 14, 107,
|
||||
},
|
||||
{
|
||||
/* 2 */
|
||||
135, 64, 57, 68,
|
||||
},
|
||||
{
|
||||
/* 3 */
|
||||
60, 56, 128, 65,
|
||||
},
|
||||
{
|
||||
/* 4 */
|
||||
159, 134, 128, 34,
|
||||
},
|
||||
{
|
||||
/* 5 */
|
||||
234, 188, 128, 28,
|
||||
},
|
||||
{ /* 0 */
|
||||
7, 1, 1, 143 },
|
||||
{ /* 1 */
|
||||
14, 18, 14, 107 },
|
||||
{ /* 2 */
|
||||
135, 64, 57, 68 },
|
||||
{ /* 3 */
|
||||
60, 56, 128, 65 },
|
||||
{ /* 4 */
|
||||
159, 134, 128, 34 },
|
||||
{ /* 5 */
|
||||
234, 188, 128, 28 },
|
||||
};
|
||||
|
@ -95,9 +95,7 @@ void vp8_sixtap_predict4x4_mmx(unsigned char *src_ptr, int src_pixels_per_line,
|
||||
void vp8_sixtap_predict16x16_sse2(unsigned char *src_ptr,
|
||||
int src_pixels_per_line, int xoffset,
|
||||
int yoffset, unsigned char *dst_ptr,
|
||||
int dst_pitch
|
||||
|
||||
) {
|
||||
int dst_pitch) {
|
||||
DECLARE_ALIGNED(16, unsigned short,
|
||||
FData2[24 * 24]); /* Temp data bufffer used in filtering */
|
||||
|
||||
@ -236,9 +234,7 @@ extern void vp8_filter_block1d4_v6_ssse3(unsigned char *src_ptr,
|
||||
void vp8_sixtap_predict16x16_ssse3(unsigned char *src_ptr,
|
||||
int src_pixels_per_line, int xoffset,
|
||||
int yoffset, unsigned char *dst_ptr,
|
||||
int dst_pitch
|
||||
|
||||
) {
|
||||
int dst_pitch) {
|
||||
DECLARE_ALIGNED(16, unsigned char, FData2[24 * 24]);
|
||||
|
||||
if (xoffset) {
|
||||
|
@ -34,7 +34,9 @@ typedef struct {
|
||||
/* Structure used to hold all the overlaps of a macroblock. The overlaps of a
|
||||
* macroblock is further divided into block overlaps.
|
||||
*/
|
||||
typedef struct { B_OVERLAP overlaps[16]; } MB_OVERLAP;
|
||||
typedef struct {
|
||||
B_OVERLAP overlaps[16];
|
||||
} MB_OVERLAP;
|
||||
|
||||
/* Structure for keeping track of motion vectors and which reference frame they
|
||||
* refer to. Used for motion vector interpolation.
|
||||
|
@ -31,7 +31,9 @@ typedef struct {
|
||||
void *ptr2;
|
||||
} DECODETHREAD_DATA;
|
||||
|
||||
typedef struct { MACROBLOCKD mbd; } MB_ROW_DEC;
|
||||
typedef struct {
|
||||
MACROBLOCKD mbd;
|
||||
} MB_ROW_DEC;
|
||||
|
||||
typedef struct {
|
||||
int enabled;
|
||||
|
@ -739,24 +739,21 @@ void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows) {
|
||||
/* Allocate memory for above_row buffers. */
|
||||
CALLOC_ARRAY(pbi->mt_yabove_row, pc->mb_rows);
|
||||
for (i = 0; i < pc->mb_rows; ++i)
|
||||
CHECK_MEM_ERROR(
|
||||
pbi->mt_yabove_row[i],
|
||||
vpx_memalign(
|
||||
16, sizeof(unsigned char) * (width + (VP8BORDERINPIXELS << 1))));
|
||||
CHECK_MEM_ERROR(pbi->mt_yabove_row[i],
|
||||
vpx_memalign(16, sizeof(unsigned char) *
|
||||
(width + (VP8BORDERINPIXELS << 1))));
|
||||
|
||||
CALLOC_ARRAY(pbi->mt_uabove_row, pc->mb_rows);
|
||||
for (i = 0; i < pc->mb_rows; ++i)
|
||||
CHECK_MEM_ERROR(
|
||||
pbi->mt_uabove_row[i],
|
||||
vpx_memalign(16,
|
||||
sizeof(unsigned char) * (uv_width + VP8BORDERINPIXELS)));
|
||||
CHECK_MEM_ERROR(pbi->mt_uabove_row[i],
|
||||
vpx_memalign(16, sizeof(unsigned char) *
|
||||
(uv_width + VP8BORDERINPIXELS)));
|
||||
|
||||
CALLOC_ARRAY(pbi->mt_vabove_row, pc->mb_rows);
|
||||
for (i = 0; i < pc->mb_rows; ++i)
|
||||
CHECK_MEM_ERROR(
|
||||
pbi->mt_vabove_row[i],
|
||||
vpx_memalign(16,
|
||||
sizeof(unsigned char) * (uv_width + VP8BORDERINPIXELS)));
|
||||
CHECK_MEM_ERROR(pbi->mt_vabove_row[i],
|
||||
vpx_memalign(16, sizeof(unsigned char) *
|
||||
(uv_width + VP8BORDERINPIXELS)));
|
||||
|
||||
/* Allocate memory for left_col buffers. */
|
||||
CALLOC_ARRAY(pbi->mt_yleft_col, pc->mb_rows);
|
||||
|
@ -989,11 +989,11 @@ static int estimate_max_q(VP8_COMP *cpi, FIRSTPASS_STATS *fpstats,
|
||||
bits_per_mb_at_this_q =
|
||||
vp8_bits_per_mb[INTER_FRAME][Q] + overhead_bits_per_mb;
|
||||
|
||||
bits_per_mb_at_this_q = (int)(.5 +
|
||||
err_correction_factor * speed_correction *
|
||||
cpi->twopass.est_max_qcorrection_factor *
|
||||
cpi->twopass.section_max_qfactor *
|
||||
(double)bits_per_mb_at_this_q);
|
||||
bits_per_mb_at_this_q =
|
||||
(int)(.5 + err_correction_factor * speed_correction *
|
||||
cpi->twopass.est_max_qcorrection_factor *
|
||||
cpi->twopass.section_max_qfactor *
|
||||
(double)bits_per_mb_at_this_q);
|
||||
|
||||
/* Mode and motion overhead */
|
||||
/* As Q rises in real encode loop rd code will force overhead down
|
||||
@ -1086,9 +1086,8 @@ static int estimate_cq(VP8_COMP *cpi, FIRSTPASS_STATS *fpstats,
|
||||
vp8_bits_per_mb[INTER_FRAME][Q] + overhead_bits_per_mb;
|
||||
|
||||
bits_per_mb_at_this_q =
|
||||
(int)(.5 +
|
||||
err_correction_factor * speed_correction * clip_iifactor *
|
||||
(double)bits_per_mb_at_this_q);
|
||||
(int)(.5 + err_correction_factor * speed_correction * clip_iifactor *
|
||||
(double)bits_per_mb_at_this_q);
|
||||
|
||||
/* Mode and motion overhead */
|
||||
/* As Q rises in real encode loop rd code will force overhead down
|
||||
@ -1273,9 +1272,8 @@ void vp8_init_second_pass(VP8_COMP *cpi) {
|
||||
* sum duration is not. Its calculated based on the actual durations of
|
||||
* all frames from the first pass.
|
||||
*/
|
||||
vp8_new_framerate(cpi,
|
||||
10000000.0 * cpi->twopass.total_stats.count /
|
||||
cpi->twopass.total_stats.duration);
|
||||
vp8_new_framerate(cpi, 10000000.0 * cpi->twopass.total_stats.count /
|
||||
cpi->twopass.total_stats.duration);
|
||||
|
||||
cpi->output_framerate = cpi->framerate;
|
||||
cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats.duration *
|
||||
@ -1739,10 +1737,11 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) {
|
||||
/* Dont break out very close to a key frame */
|
||||
((cpi->twopass.frames_to_key - i) >= MIN_GF_INTERVAL) &&
|
||||
((boost_score > 20.0) || (next_frame.pcnt_inter < 0.75)) &&
|
||||
(!flash_detected) && ((mv_ratio_accumulator > 100.0) ||
|
||||
(abs_mv_in_out_accumulator > 3.0) ||
|
||||
(mv_in_out_accumulator < -2.0) ||
|
||||
((boost_score - old_boost_score) < 2.0)))) {
|
||||
(!flash_detected) &&
|
||||
((mv_ratio_accumulator > 100.0) ||
|
||||
(abs_mv_in_out_accumulator > 3.0) ||
|
||||
(mv_in_out_accumulator < -2.0) ||
|
||||
((boost_score - old_boost_score) < 2.0)))) {
|
||||
boost_score = old_boost_score;
|
||||
break;
|
||||
}
|
||||
@ -1815,8 +1814,9 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) {
|
||||
(next_frame.pcnt_inter > 0.75) &&
|
||||
((mv_in_out_accumulator / (double)i > -0.2) ||
|
||||
(mv_in_out_accumulator > -2.0)) &&
|
||||
(cpi->gfu_boost > 100) && (cpi->twopass.gf_decay_rate <=
|
||||
(ARF_DECAY_THRESH + (cpi->gfu_boost / 200))))
|
||||
(cpi->gfu_boost > 100) &&
|
||||
(cpi->twopass.gf_decay_rate <=
|
||||
(ARF_DECAY_THRESH + (cpi->gfu_boost / 200))))
|
||||
#endif
|
||||
{
|
||||
int Boost;
|
||||
|
@ -2862,7 +2862,6 @@ void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame)
|
||||
fclose(yframe);
|
||||
}
|
||||
#endif
|
||||
/* return of 0 means drop frame */
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
/* Function to test for conditions that indeicate we should loop
|
||||
@ -4786,8 +4785,6 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
|
||||
cpi->temporal_pattern_counter++;
|
||||
}
|
||||
|
||||
/* reset to normal state now that we are done. */
|
||||
|
||||
#if 0
|
||||
{
|
||||
char filename[512];
|
||||
|
@ -1052,9 +1052,8 @@ void vp8_update_rate_correction_factors(VP8_COMP *cpi, int damp_var) {
|
||||
* overflow when values are large
|
||||
*/
|
||||
projected_size_based_on_q =
|
||||
(int)(((.5 +
|
||||
rate_correction_factor *
|
||||
vp8_bits_per_mb[cpi->common.frame_type][Q]) *
|
||||
(int)(((.5 + rate_correction_factor *
|
||||
vp8_bits_per_mb[cpi->common.frame_type][Q]) *
|
||||
cpi->common.MBs) /
|
||||
(1 << BPER_MB_NORMBITS));
|
||||
|
||||
|
@ -770,9 +770,9 @@ static void rd_pick_intra_mbuv_mode(MACROBLOCK *x, int *rate,
|
||||
vp8_quantize_mbuv(x);
|
||||
|
||||
rate_to = rd_cost_mbuv(x);
|
||||
this_rate = rate_to +
|
||||
x->intra_uv_mode_cost[xd->frame_type]
|
||||
[xd->mode_info_context->mbmi.uv_mode];
|
||||
this_rate =
|
||||
rate_to + x->intra_uv_mode_cost[xd->frame_type]
|
||||
[xd->mode_info_context->mbmi.uv_mode];
|
||||
|
||||
this_distortion = vp8_mbuverror(x) / 4;
|
||||
|
||||
|
@ -56,8 +56,7 @@ static INLINE unsigned int vp8_cost_branch(const unsigned int ct[2],
|
||||
|
||||
static void vp8_treed_write(vp8_writer *const w, vp8_tree t,
|
||||
const vp8_prob *const p, int v,
|
||||
int n /* number of bits in v, assumed nonzero */
|
||||
) {
|
||||
int n) { /* number of bits in v, assumed nonzero */
|
||||
vp8_tree_index i = 0;
|
||||
|
||||
do {
|
||||
@ -73,8 +72,7 @@ static INLINE void vp8_write_token(vp8_writer *const w, vp8_tree t,
|
||||
}
|
||||
|
||||
static int vp8_treed_cost(vp8_tree t, const vp8_prob *const p, int v,
|
||||
int n /* number of bits in v, assumed nonzero */
|
||||
) {
|
||||
int n) { /* number of bits in v, assumed nonzero */
|
||||
int c = 0;
|
||||
vp8_tree_index i = 0;
|
||||
|
||||
|
@ -1270,6 +1270,9 @@ CODEC_INTERFACE(vpx_codec_vp8_cx) = {
|
||||
vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t cfg_maps; */
|
||||
vp8e_encode, /* vpx_codec_encode_fn_t encode; */
|
||||
vp8e_get_cxdata, /* vpx_codec_get_cx_data_fn_t get_cx_data; */
|
||||
vp8e_set_config, NULL, vp8e_get_preview, vp8e_mr_alloc_mem,
|
||||
vp8e_set_config,
|
||||
NULL,
|
||||
vp8e_get_preview,
|
||||
vp8e_mr_alloc_mem,
|
||||
} /* encoder functions */
|
||||
};
|
||||
|
@ -42,6 +42,7 @@ const vpx_prob vp9_cat6_prob_high12[] = { 255, 255, 255, 255, 254, 254,
|
||||
177, 153, 140, 133, 130, 129 };
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
const uint8_t vp9_coefband_trans_8x8plus[1024] = {
|
||||
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
|
||||
// beyond MAXBAND_INDEX+1 all values are filled as 5
|
||||
@ -85,6 +86,7 @@ const uint8_t vp9_coefband_trans_8x8plus[1024] = {
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
const uint8_t vp9_coefband_trans_4x4[16] = {
|
||||
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5,
|
||||
|
@ -137,7 +137,6 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
|
||||
// 128 lists of probabilities are stored for the following ONE node probs:
|
||||
// 1, 3, 5, 7, ..., 253, 255
|
||||
// In between probabilities are interpolated linearly
|
||||
|
||||
#define COEFF_PROB_MODELS 255
|
||||
|
||||
#define UNCONSTRAINED_NODES 3
|
||||
|
@ -186,16 +186,19 @@ const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS][PARTITION_TYPES - 1] =
|
||||
{ 93, 24, 99 }, // a split, l not split
|
||||
{ 85, 119, 44 }, // l split, a not split
|
||||
{ 62, 59, 67 }, // a/l both split
|
||||
|
||||
// 16x16 -> 8x8
|
||||
{ 149, 53, 53 }, // a/l both not split
|
||||
{ 94, 20, 48 }, // a split, l not split
|
||||
{ 83, 53, 24 }, // l split, a not split
|
||||
{ 52, 18, 18 }, // a/l both split
|
||||
|
||||
// 32x32 -> 16x16
|
||||
{ 150, 40, 39 }, // a/l both not split
|
||||
{ 78, 12, 26 }, // a split, l not split
|
||||
{ 67, 33, 11 }, // l split, a not split
|
||||
{ 24, 7, 5 }, // a/l both split
|
||||
|
||||
// 64x64 -> 32x32
|
||||
{ 174, 35, 49 }, // a/l both not split
|
||||
{ 68, 11, 27 }, // a split, l not split
|
||||
|
@ -22,9 +22,7 @@ const vpx_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = {
|
||||
18, -MV_CLASS_7, -MV_CLASS_8, -MV_CLASS_9, -MV_CLASS_10,
|
||||
};
|
||||
|
||||
const vpx_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = {
|
||||
-0, -1,
|
||||
};
|
||||
const vpx_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = { -0, -1 };
|
||||
|
||||
const vpx_tree_index vp9_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { -0, 2, -1,
|
||||
4, -2, -3 };
|
||||
|
@ -229,9 +229,8 @@ int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
|
||||
else
|
||||
pred_context = 4 * (edge_mi->ref_frame[0] == GOLDEN_FRAME);
|
||||
} else {
|
||||
pred_context = 1 +
|
||||
2 * (edge_mi->ref_frame[0] == GOLDEN_FRAME ||
|
||||
edge_mi->ref_frame[1] == GOLDEN_FRAME);
|
||||
pred_context = 1 + 2 * (edge_mi->ref_frame[0] == GOLDEN_FRAME ||
|
||||
edge_mi->ref_frame[1] == GOLDEN_FRAME);
|
||||
}
|
||||
} else { // inter/inter
|
||||
const int above_has_second = has_second_ref(above_mi);
|
||||
|
@ -12,7 +12,10 @@
|
||||
#include "vp9/encoder/vp9_encoder.h"
|
||||
|
||||
static const BLOCK_SIZE square[] = {
|
||||
BLOCK_8X8, BLOCK_16X16, BLOCK_32X32, BLOCK_64X64,
|
||||
BLOCK_8X8,
|
||||
BLOCK_16X16,
|
||||
BLOCK_32X32,
|
||||
BLOCK_64X64,
|
||||
};
|
||||
|
||||
static void alloc_mode_context(VP9_COMMON *cm, int num_4x4_blk,
|
||||
|
@ -1513,9 +1513,9 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_key_frame || (low_res &&
|
||||
vt.split[i].split[j].part_variances.none.variance >
|
||||
threshold_4x4avg)) {
|
||||
if (is_key_frame ||
|
||||
(low_res && vt.split[i].split[j].part_variances.none.variance >
|
||||
threshold_4x4avg)) {
|
||||
force_split[split_index] = 0;
|
||||
// Go down to 4x4 down-sampling for variance.
|
||||
variance4x4downsample[i2 + j] = 1;
|
||||
@ -3403,9 +3403,10 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td,
|
||||
|
||||
// Rate and distortion based partition search termination clause.
|
||||
if (!cpi->sf.ml_partition_search_early_termination &&
|
||||
!x->e_mbd.lossless && ((best_rdc.dist < (dist_breakout_thr >> 2)) ||
|
||||
(best_rdc.dist < dist_breakout_thr &&
|
||||
best_rdc.rate < rate_breakout_thr))) {
|
||||
!x->e_mbd.lossless &&
|
||||
((best_rdc.dist < (dist_breakout_thr >> 2)) ||
|
||||
(best_rdc.dist < dist_breakout_thr &&
|
||||
best_rdc.rate < rate_breakout_thr))) {
|
||||
do_rect = 0;
|
||||
}
|
||||
}
|
||||
@ -4620,8 +4621,9 @@ void vp9_init_tile_data(VP9_COMP *cpi) {
|
||||
|
||||
if (cpi->tile_data == NULL || cpi->allocated_tiles < tile_cols * tile_rows) {
|
||||
if (cpi->tile_data != NULL) vpx_free(cpi->tile_data);
|
||||
CHECK_MEM_ERROR(cm, cpi->tile_data, vpx_malloc(tile_cols * tile_rows *
|
||||
sizeof(*cpi->tile_data)));
|
||||
CHECK_MEM_ERROR(
|
||||
cm, cpi->tile_data,
|
||||
vpx_malloc(tile_cols * tile_rows * sizeof(*cpi->tile_data)));
|
||||
cpi->allocated_tiles = tile_cols * tile_rows;
|
||||
|
||||
for (tile_row = 0; tile_row < tile_rows; ++tile_row)
|
||||
|
@ -50,7 +50,8 @@ void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
||||
}
|
||||
|
||||
static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] = {
|
||||
{ 10, 6 }, { 8, 5 },
|
||||
{ 10, 6 },
|
||||
{ 8, 5 },
|
||||
};
|
||||
|
||||
// 'num' can be negative, but 'shift' must be non-negative.
|
||||
@ -200,9 +201,9 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
|
||||
const int band_next = band_translate[i + 1];
|
||||
const int token_next =
|
||||
(i + 1 != eob) ? vp9_get_token(qcoeff[scan[i + 1]]) : EOB_TOKEN;
|
||||
unsigned int(
|
||||
*const token_costs_next)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
|
||||
token_costs + band_next;
|
||||
unsigned int(*const token_costs_next)[2][COEFF_CONTEXTS]
|
||||
[ENTROPY_TOKENS] =
|
||||
token_costs + band_next;
|
||||
token_cache[rc] = vp9_pt_energy_class[t0];
|
||||
ctx_next = get_coef_context(nb, token_cache, i + 1);
|
||||
token_tree_sel_next = (x == 0);
|
||||
|
@ -65,12 +65,12 @@
|
||||
#define AM_SEGMENT_ID_INACTIVE 7
|
||||
#define AM_SEGMENT_ID_ACTIVE 0
|
||||
|
||||
#define ALTREF_HIGH_PRECISION_MV 1 // Whether to use high precision mv
|
||||
// for altref computation.
|
||||
#define HIGH_PRECISION_MV_QTHRESH 200 // Q threshold for high precision
|
||||
// mv. Choose a very high value for
|
||||
// now so that HIGH_PRECISION is always
|
||||
// chosen.
|
||||
// Whether to use high precision mv for altref computation.
|
||||
#define ALTREF_HIGH_PRECISION_MV 1
|
||||
|
||||
// Q threshold for high precision mv. Choose a very high value for now so that
|
||||
// HIGH_PRECISION is always chosen.
|
||||
#define HIGH_PRECISION_MV_QTHRESH 200
|
||||
|
||||
#define FRAME_SIZE_FACTOR 128 // empirical params for context model threshold
|
||||
#define FRAME_RATE_FACTOR 8
|
||||
@ -2017,8 +2017,9 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
|
||||
|
||||
realloc_segmentation_maps(cpi);
|
||||
|
||||
CHECK_MEM_ERROR(cm, cpi->skin_map, vpx_calloc(cm->mi_rows * cm->mi_cols,
|
||||
sizeof(cpi->skin_map[0])));
|
||||
CHECK_MEM_ERROR(
|
||||
cm, cpi->skin_map,
|
||||
vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(cpi->skin_map[0])));
|
||||
|
||||
CHECK_MEM_ERROR(cm, cpi->alt_ref_aq, vp9_alt_ref_aq_create());
|
||||
|
||||
|
@ -868,9 +868,8 @@ static INLINE int is_one_pass_cbr_svc(const struct VP9_COMP *const cpi) {
|
||||
|
||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||
static INLINE int denoise_svc(const struct VP9_COMP *const cpi) {
|
||||
return (!cpi->use_svc ||
|
||||
(cpi->use_svc &&
|
||||
cpi->svc.spatial_layer_id >= cpi->svc.first_layer_denoise));
|
||||
return (!cpi->use_svc || (cpi->use_svc && cpi->svc.spatial_layer_id >=
|
||||
cpi->svc.first_layer_denoise));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -731,9 +731,8 @@ static void first_pass_stat_calc(VP9_COMP *cpi, FIRSTPASS_STATS *fps,
|
||||
// Exclude any image dead zone
|
||||
if (fp_acc_data->image_data_start_row > 0) {
|
||||
fp_acc_data->intra_skip_count =
|
||||
VPXMAX(0,
|
||||
fp_acc_data->intra_skip_count -
|
||||
(fp_acc_data->image_data_start_row * cm->mb_cols * 2));
|
||||
VPXMAX(0, fp_acc_data->intra_skip_count -
|
||||
(fp_acc_data->image_data_start_row * cm->mb_cols * 2));
|
||||
}
|
||||
|
||||
fp_acc_data->intra_factor = fp_acc_data->intra_factor / (double)num_mbs;
|
||||
|
@ -25,7 +25,9 @@ typedef struct {
|
||||
} ref[MAX_REF_FRAMES];
|
||||
} MBGRAPH_MB_STATS;
|
||||
|
||||
typedef struct { MBGRAPH_MB_STATS *mb_stats; } MBGRAPH_FRAME_STATS;
|
||||
typedef struct {
|
||||
MBGRAPH_MB_STATS *mb_stats;
|
||||
} MBGRAPH_FRAME_STATS;
|
||||
|
||||
struct VP9_COMP;
|
||||
|
||||
|
@ -1785,7 +1785,10 @@ static int vector_match(int16_t *ref, int16_t *src, int bwl) {
|
||||
}
|
||||
|
||||
static const MV search_pos[4] = {
|
||||
{ -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 },
|
||||
{ -1, 0 },
|
||||
{ 0, -1 },
|
||||
{ 0, 1 },
|
||||
{ 1, 0 },
|
||||
};
|
||||
|
||||
unsigned int vp9_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x,
|
||||
@ -1876,7 +1879,10 @@ unsigned int vp9_int_pro_motion_estimation(const VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
{
|
||||
const uint8_t *const pos[4] = {
|
||||
ref_buf - ref_stride, ref_buf - 1, ref_buf + 1, ref_buf + ref_stride,
|
||||
ref_buf - ref_stride,
|
||||
ref_buf - 1,
|
||||
ref_buf + 1,
|
||||
ref_buf + ref_stride,
|
||||
};
|
||||
|
||||
cpi->fn_ptr[bsize].sdx4df(src_buf, src_stride, pos, ref_stride, this_sad);
|
||||
|
@ -1785,9 +1785,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sf->reference_masking &&
|
||||
!(frame_mv[this_mode][ref_frame].as_int == 0 &&
|
||||
ref_frame == LAST_FRAME)) {
|
||||
if (sf->reference_masking && !(frame_mv[this_mode][ref_frame].as_int == 0 &&
|
||||
ref_frame == LAST_FRAME)) {
|
||||
if (usable_ref_frame < ALTREF_FRAME) {
|
||||
if (!force_skip_low_temp_var && usable_ref_frame > LAST_FRAME) {
|
||||
i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME;
|
||||
|
@ -1584,9 +1584,8 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
|
||||
// Adjust boost and af_ratio based on avg_frame_low_motion, which varies
|
||||
// between 0 and 100 (stationary, 100% zero/small motion).
|
||||
rc->gfu_boost =
|
||||
VPXMAX(500,
|
||||
DEFAULT_GF_BOOST * (rc->avg_frame_low_motion << 1) /
|
||||
(rc->avg_frame_low_motion + 100));
|
||||
VPXMAX(500, DEFAULT_GF_BOOST * (rc->avg_frame_low_motion << 1) /
|
||||
(rc->avg_frame_low_motion + 100));
|
||||
rc->af_ratio_onepass_vbr = VPXMIN(15, VPXMAX(5, 3 * rc->gfu_boost / 400));
|
||||
}
|
||||
adjust_gfint_frame_constraint(cpi, rc->frames_to_key);
|
||||
|
@ -59,7 +59,9 @@ typedef struct {
|
||||
MV_REFERENCE_FRAME ref_frame[2];
|
||||
} MODE_DEFINITION;
|
||||
|
||||
typedef struct { MV_REFERENCE_FRAME ref_frame[2]; } REF_DEFINITION;
|
||||
typedef struct {
|
||||
MV_REFERENCE_FRAME ref_frame[2];
|
||||
} REF_DEFINITION;
|
||||
|
||||
struct rdcost_block_args {
|
||||
const VP9_COMP *cpi;
|
||||
|
@ -1067,12 +1067,11 @@ static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP9_COMP *cpi,
|
||||
vpx_codec_frame_flags_t flags = lib_flags << 16;
|
||||
|
||||
if (lib_flags & FRAMEFLAGS_KEY ||
|
||||
(cpi->use_svc &&
|
||||
cpi->svc
|
||||
.layer_context[cpi->svc.spatial_layer_id *
|
||||
cpi->svc.number_temporal_layers +
|
||||
cpi->svc.temporal_layer_id]
|
||||
.is_key_frame))
|
||||
(cpi->use_svc && cpi->svc
|
||||
.layer_context[cpi->svc.spatial_layer_id *
|
||||
cpi->svc.number_temporal_layers +
|
||||
cpi->svc.temporal_layer_id]
|
||||
.is_key_frame))
|
||||
flags |= VPX_FRAME_IS_KEY;
|
||||
|
||||
if (cpi->droppable) flags |= VPX_FRAME_IS_DROPPABLE;
|
||||
|
@ -667,8 +667,6 @@ void vpx_d135_predictor_32x32_neon(uint8_t *dst, ptrdiff_t stride,
|
||||
d135_store_32x2(&dst, stride, row_0, row_1, row_2);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#if !HAVE_NEON_ASM
|
||||
|
||||
void vpx_v_predictor_4x4_neon(uint8_t *dst, ptrdiff_t stride,
|
||||
|
@ -76,7 +76,6 @@ static INLINE tran_high_t highbd_check_range(tran_high_t input, int bd) {
|
||||
// bd of 10 uses trans_low with 18bits, need to remove 14bits
|
||||
// bd of 12 uses trans_low with 20bits, need to remove 12bits
|
||||
// bd of x uses trans_low with 8+x bits, need to remove 24-x bits
|
||||
|
||||
#define WRAPLOW(x) ((((int32_t)check_range(x)) << 16) >> 16)
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#define HIGHBD_WRAPLOW(x, bd) \
|
||||
|
@ -14,38 +14,37 @@
|
||||
|
||||
extern const int16_t vpx_rv[];
|
||||
|
||||
#define VPX_TRANSPOSE8x16_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, out0, \
|
||||
out1, out2, out3, out4, out5, out6, out7, \
|
||||
out8, out9, out10, out11, out12, out13, out14, \
|
||||
out15) \
|
||||
{ \
|
||||
v8i16 temp0, temp1, temp2, temp3, temp4; \
|
||||
v8i16 temp5, temp6, temp7, temp8, temp9; \
|
||||
\
|
||||
ILVR_B4_SH(in1, in0, in3, in2, in5, in4, in7, in6, temp0, temp1, temp2, \
|
||||
temp3); \
|
||||
ILVR_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_SH(temp5, temp4, temp6, temp7); \
|
||||
ILVL_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_SH(temp5, temp4, temp8, temp9); \
|
||||
ILVL_B4_SH(in1, in0, in3, in2, in5, in4, in7, in6, temp0, temp1, temp2, \
|
||||
temp3); \
|
||||
ILVR_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_UB(temp5, temp4, out8, out10); \
|
||||
ILVL_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_UB(temp5, temp4, out12, out14); \
|
||||
out0 = (v16u8)temp6; \
|
||||
out2 = (v16u8)temp7; \
|
||||
out4 = (v16u8)temp8; \
|
||||
out6 = (v16u8)temp9; \
|
||||
out9 = (v16u8)__msa_ilvl_d((v2i64)out8, (v2i64)out8); \
|
||||
out11 = (v16u8)__msa_ilvl_d((v2i64)out10, (v2i64)out10); \
|
||||
out13 = (v16u8)__msa_ilvl_d((v2i64)out12, (v2i64)out12); \
|
||||
out15 = (v16u8)__msa_ilvl_d((v2i64)out14, (v2i64)out14); \
|
||||
out1 = (v16u8)__msa_ilvl_d((v2i64)out0, (v2i64)out0); \
|
||||
out3 = (v16u8)__msa_ilvl_d((v2i64)out2, (v2i64)out2); \
|
||||
out5 = (v16u8)__msa_ilvl_d((v2i64)out4, (v2i64)out4); \
|
||||
out7 = (v16u8)__msa_ilvl_d((v2i64)out6, (v2i64)out6); \
|
||||
#define VPX_TRANSPOSE8x16_UB_UB( \
|
||||
in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3, out4, \
|
||||
out5, out6, out7, out8, out9, out10, out11, out12, out13, out14, out15) \
|
||||
{ \
|
||||
v8i16 temp0, temp1, temp2, temp3, temp4; \
|
||||
v8i16 temp5, temp6, temp7, temp8, temp9; \
|
||||
\
|
||||
ILVR_B4_SH(in1, in0, in3, in2, in5, in4, in7, in6, temp0, temp1, temp2, \
|
||||
temp3); \
|
||||
ILVR_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_SH(temp5, temp4, temp6, temp7); \
|
||||
ILVL_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_SH(temp5, temp4, temp8, temp9); \
|
||||
ILVL_B4_SH(in1, in0, in3, in2, in5, in4, in7, in6, temp0, temp1, temp2, \
|
||||
temp3); \
|
||||
ILVR_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_UB(temp5, temp4, out8, out10); \
|
||||
ILVL_H2_SH(temp1, temp0, temp3, temp2, temp4, temp5); \
|
||||
ILVRL_W2_UB(temp5, temp4, out12, out14); \
|
||||
out0 = (v16u8)temp6; \
|
||||
out2 = (v16u8)temp7; \
|
||||
out4 = (v16u8)temp8; \
|
||||
out6 = (v16u8)temp9; \
|
||||
out9 = (v16u8)__msa_ilvl_d((v2i64)out8, (v2i64)out8); \
|
||||
out11 = (v16u8)__msa_ilvl_d((v2i64)out10, (v2i64)out10); \
|
||||
out13 = (v16u8)__msa_ilvl_d((v2i64)out12, (v2i64)out12); \
|
||||
out15 = (v16u8)__msa_ilvl_d((v2i64)out14, (v2i64)out14); \
|
||||
out1 = (v16u8)__msa_ilvl_d((v2i64)out0, (v2i64)out0); \
|
||||
out3 = (v16u8)__msa_ilvl_d((v2i64)out2, (v2i64)out2); \
|
||||
out5 = (v16u8)__msa_ilvl_d((v2i64)out4, (v2i64)out4); \
|
||||
out7 = (v16u8)__msa_ilvl_d((v2i64)out6, (v2i64)out6); \
|
||||
}
|
||||
|
||||
#define VPX_AVER_IF_RETAIN(above2_in, above1_in, src_in, below1_in, below2_in, \
|
||||
|
@ -778,6 +778,7 @@ void FDCT16x16_2D(const int16_t *input, tran_low_t *output, int stride) {
|
||||
return;
|
||||
}
|
||||
#endif // DCT_HIGH_BIT_DEPTH
|
||||
|
||||
// Interleave to do the multiply by constants which gets us
|
||||
// into 32 bits.
|
||||
{
|
||||
@ -834,6 +835,7 @@ void FDCT16x16_2D(const int16_t *input, tran_low_t *output, int stride) {
|
||||
return;
|
||||
}
|
||||
#endif // DCT_HIGH_BIT_DEPTH
|
||||
|
||||
// Interleave to do the multiply by constants which gets us
|
||||
// into 32 bits.
|
||||
{
|
||||
|
@ -192,8 +192,6 @@ void vpx_highbd_convolve_avg_avx2(const uint16_t *src, ptrdiff_t src_stride,
|
||||
// -----------------------------------------------------------------------------
|
||||
// Horizontal and vertical filtering
|
||||
|
||||
#define CONV8_ROUNDING_BITS (7)
|
||||
|
||||
static const uint8_t signal_pattern_0[32] = { 0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6,
|
||||
7, 6, 7, 8, 9, 0, 1, 2, 3, 2, 3,
|
||||
4, 5, 4, 5, 6, 7, 6, 7, 8, 9 };
|
||||
@ -210,6 +208,8 @@ static const uint8_t signal_pattern_2[32] = { 6, 7, 8, 9, 8, 9, 10, 11,
|
||||
|
||||
static const uint32_t signal_index[8] = { 2, 3, 4, 5, 2, 3, 4, 5 };
|
||||
|
||||
#define CONV8_ROUNDING_BITS (7)
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Horizontal Filtering
|
||||
|
||||
|
@ -224,5 +224,4 @@ static VPX_INLINE void mem_put_le32(void *vmem, MEM_VALUE_T val) {
|
||||
mem[3] = (MAU_T)((val >> 24) & 0xff);
|
||||
}
|
||||
/* clang-format on */
|
||||
|
||||
#endif // VPX_PORTS_MEM_OPS_H_
|
||||
|
@ -68,7 +68,9 @@ extern "C" {
|
||||
// on any platform (to discourage programmer errors by setting values directly).
|
||||
// This primitive MUST be initialized using vpx_atomic_init or VPX_ATOMIC_INIT
|
||||
// (NOT memset) and accessed through vpx_atomic_ functions.
|
||||
typedef struct vpx_atomic_int { volatile int value; } vpx_atomic_int;
|
||||
typedef struct vpx_atomic_int {
|
||||
volatile int value;
|
||||
} vpx_atomic_int;
|
||||
|
||||
#define VPX_ATOMIC_INIT(num) \
|
||||
{ num }
|
||||
|
6
vpxenc.c
6
vpxenc.c
@ -2215,9 +2215,9 @@ int main(int argc, const char **argv_) {
|
||||
|
||||
if (!global.quiet) {
|
||||
FOREACH_STREAM(fprintf(
|
||||
stderr, "\rPass %d/%d frame %4d/%-4d %7" PRId64 "B %7" PRId64
|
||||
"b/f %7" PRId64 "b/s"
|
||||
" %7" PRId64 " %s (%.2f fps)\033[K\n",
|
||||
stderr,
|
||||
"\rPass %d/%d frame %4d/%-4d %7" PRId64 "B %7" PRId64 "b/f %7" PRId64
|
||||
"b/s %7" PRId64 " %s (%.2f fps)\033[K\n",
|
||||
pass + 1, global.passes, frames_in, stream->frames_out,
|
||||
(int64_t)stream->nbytes,
|
||||
seen_frames ? (int64_t)(stream->nbytes * 8 / seen_frames) : 0,
|
||||
|
@ -139,7 +139,6 @@ static int y4m_parse_tags(y4m_input *_y4m, char *_tags) {
|
||||
Conversions which require both horizontal and vertical filtering could
|
||||
have these steps pipelined, for less memory consumption and better cache
|
||||
performance, but we do them separately for simplicity.*/
|
||||
|
||||
#define OC_MINI(_a, _b) ((_a) > (_b) ? (_b) : (_a))
|
||||
#define OC_MAXI(_a, _b) ((_a) < (_b) ? (_b) : (_a))
|
||||
#define OC_CLAMPI(_a, _b, _c) (OC_MAXI(_a, OC_MINI(_b, _c)))
|
||||
|
Loading…
Reference in New Issue
Block a user