Commit 476e44a6 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review
Browse files

Merge "Replace variants of 'vp8' and 'vp9' with 'vpx'" into nextgenv2

parents 59589d0c fe291b64
......@@ -27,7 +27,7 @@ class CpuSpeedTest
encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)),
min_psnr_(kMaxPSNR),
tune_content_(VP9E_CONTENT_DEFAULT) {}
tune_content_(VPX_CONTENT_DEFAULT) {}
virtual ~CpuSpeedTest() {}
virtual void SetUp() {
......@@ -114,7 +114,7 @@ TEST_P(CpuSpeedTest, TestTuneScreen) {
cfg_.rc_target_bitrate = 2000;
cfg_.rc_max_quantizer = 63;
cfg_.rc_min_quantizer = 0;
tune_content_ = VP9E_CONTENT_SCREEN;
tune_content_ = VPX_CONTENT_SCREEN;
init_flags_ = VPX_CODEC_USE_PSNR;
......
......@@ -143,9 +143,9 @@ class EndToEndTestLarge
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
// Test screen coding tools at cpu_used = 1 && encoding mode is two-pass.
if (cpu_used_ == 1 && encoding_mode_ == ::libvpx_test::kTwoPassGood)
encoder->Control(VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN);
encoder->Control(VP9E_SET_TUNE_CONTENT, VPX_CONTENT_SCREEN);
else
encoder->Control(VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_DEFAULT);
encoder->Control(VP9E_SET_TUNE_CONTENT, VPX_CONTENT_DEFAULT);
if (encoding_mode_ != ::libvpx_test::kRealTime) {
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
......
......@@ -34,21 +34,21 @@ void vp10_iht4x4_16_add_msa(const int16_t *input, uint8_t *dst,
VPX_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
/* ADST in vertical */
TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
VPX_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
break;
case DCT_ADST:
/* ADST in horizontal */
VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
VPX_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
/* DCT in vertical */
TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
VPX_IDCT4x4(in0, in1, in2, in3, in0, in1, in2, in3);
break;
case ADST_ADST:
/* ADST in horizontal */
VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
VPX_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
/* ADST in vertical */
TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, in0, in1, in2, in3);
VP9_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
VPX_IADST4x4(in0, in1, in2, in3, in0, in1, in2, in3);
break;
default:
assert(0);
......
......@@ -3099,7 +3099,7 @@ void FDCT32x32_2D(const int16_t *input,
tr2_6 = _mm_sub_epi16(tr2_6, tr2_6_0);
tr2_7 = _mm_sub_epi16(tr2_7, tr2_7_0);
// ... and here.
// PS: also change code in vp9/encoder/vp9_dct.c
// PS: also change code in vp10/encoder/dct.c
tr2_0 = _mm_add_epi16(tr2_0, kOne);
tr2_1 = _mm_add_epi16(tr2_1, kOne);
tr2_2 = _mm_add_epi16(tr2_2, kOne);
......
......@@ -416,7 +416,7 @@ static void cyclic_refresh_update_map(VP10_COMP *const cpi) {
int mi_row = sb_row_index * cm->mib_size;
int mi_col = sb_col_index * cm->mib_size;
int qindex_thresh =
cpi->oxcf.content == VP9E_CONTENT_SCREEN
cpi->oxcf.content == VPX_CONTENT_SCREEN
? vp10_get_qindex(&cm->seg, CR_SEGMENT_ID_BOOST2, cm->base_qindex)
: 0;
assert(mi_row >= 0 && mi_row < cm->mi_rows);
......
......@@ -2245,7 +2245,7 @@ void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
REFRESH_FRAME_CONTEXT_FORWARD : REFRESH_FRAME_CONTEXT_BACKWARD;
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
cm->allow_screen_content_tools = (cpi->oxcf.content == VP9E_CONTENT_SCREEN);
cm->allow_screen_content_tools = (cpi->oxcf.content == VPX_CONTENT_SCREEN);
if (cm->allow_screen_content_tools) {
MACROBLOCK *x = &cpi->td.mb;
if (x->palette_buffer == 0) {
......
......@@ -246,8 +246,8 @@ typedef struct VP10EncoderConfig {
vpx_fixed_buf_t firstpass_mb_stats_in;
#endif
vp8e_tuning tuning;
vp9e_tune_content content;
vpx_tune_metric tuning;
vpx_tune_content content;
#if CONFIG_VP9_HIGHBITDEPTH
int use_highbitdepth;
#endif
......
......@@ -271,7 +271,7 @@ static void set_rt_speed_feature_framesize_dependent(VP10_COMP *cpi,
}
static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
int speed, vp9e_tune_content content) {
int speed, vpx_tune_content content) {
VP10_COMMON *const cm = &cpi->common;
const int is_keyframe = cm->frame_type == KEY_FRAME;
const int frames_since_key = is_keyframe ? 0 : cpi->rc.frames_since_key;
......@@ -398,7 +398,7 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
if (!is_keyframe) {
int i;
if (content == VP9E_CONTENT_SCREEN) {
if (content == VPX_CONTENT_SCREEN) {
for (i = 0; i < BLOCK_SIZES; ++i)
sf->intra_y_mode_bsize_mask[i] = INTRA_DC_TM_H_V;
} else {
......
......@@ -37,7 +37,7 @@ struct vp10_extracfg {
unsigned int arnr_strength;
unsigned int min_gf_interval;
unsigned int max_gf_interval;
vp8e_tuning tuning;
vpx_tune_metric tuning;
unsigned int cq_level; // constrained quality level
unsigned int rc_max_intra_bitrate_pct;
unsigned int rc_max_inter_bitrate_pct;
......@@ -47,7 +47,7 @@ struct vp10_extracfg {
AQ_MODE aq_mode;
unsigned int frame_periodic_boost;
vpx_bit_depth_t bit_depth;
vp9e_tune_content content;
vpx_tune_content content;
vpx_color_space_t color_space;
int color_range;
int render_width;
......@@ -75,7 +75,7 @@ static struct vp10_extracfg default_extra_cfg = {
5, // arnr_strength
0, // min_gf_interval; 0 -> default decision
0, // max_gf_interval; 0 -> default decision
VP8_TUNE_PSNR, // tuning
VPX_TUNE_PSNR, // tuning
10, // cq_level
0, // rc_max_intra_bitrate_pct
0, // rc_max_inter_bitrate_pct
......@@ -85,7 +85,7 @@ static struct vp10_extracfg default_extra_cfg = {
NO_AQ, // aq_mode
0, // frame_periodic_delta_q
VPX_BITS_8, // Bit depth
VP9E_CONTENT_DEFAULT, // content
VPX_CONTENT_DEFAULT, // content
VPX_CS_UNKNOWN, // color space
0, // color range
0, // render width
......@@ -241,10 +241,10 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK(cfg, g_bit_depth, VPX_BITS_8, VPX_BITS_12);
RANGE_CHECK(cfg, g_input_bit_depth, 8, 12);
RANGE_CHECK(extra_cfg, content,
VP9E_CONTENT_DEFAULT, VP9E_CONTENT_INVALID - 1);
VPX_CONTENT_DEFAULT, VPX_CONTENT_INVALID - 1);
// TODO(yaowu): remove this when ssim tuning is implemented for vp9
if (extra_cfg->tuning == VP8_TUNE_SSIM)
if (extra_cfg->tuning == VPX_TUNE_SSIM)
ERROR("Option --tune=ssim is not currently supported in VP9.");
if (cfg->g_pass == VPX_RC_LAST_PASS) {
......
......@@ -27,27 +27,9 @@
extern "C" {
#endif
/*!\name Algorithm interface for VP8
*
* This interface provides the capability to encode raw VP8 streams.
* @{
*/
extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
/*!@} - end algorithm interface member group*/
/*!\name Algorithm interface for VP9
*
* This interface provides the capability to encode raw VP9 streams.
* @{
*/
extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
/*!@} - end algorithm interface member group*/
/*!\name Algorithm interface for VP10
*
* This interface provides the capability to encode raw VP9 streams.
* This interface provides the capability to encode raw VP10 streams.
* @{
*/
extern vpx_codec_iface_t vpx_codec_vp10_cx_algo;
......@@ -474,8 +456,8 @@ enum vp8e_enc_control_id {
/*!\brief Codec control function to set content type.
* \note Valid parameter range:
* VP9E_CONTENT_DEFAULT = Regular video content (Default)
* VP9E_CONTENT_SCREEN = Screen capture content
* VPX_CONTENT_DEFAULT = Regular video content (Default)
* VPX_CONTENT_SCREEN = Screen capture content
*
* Supported in codecs: VP9
*/
......@@ -692,10 +674,10 @@ typedef enum {
/*!brief VP9 encoder content type */
typedef enum {
VP9E_CONTENT_DEFAULT,
VP9E_CONTENT_SCREEN,
VP9E_CONTENT_INVALID
} vp9e_tune_content;
VPX_CONTENT_DEFAULT,
VPX_CONTENT_SCREEN,
VPX_CONTENT_INVALID
} vpx_tune_content;
/*!\brief VP8 model tuning parameters
*
......@@ -703,9 +685,9 @@ typedef enum {
*
*/
typedef enum {
VP8_TUNE_PSNR,
VP8_TUNE_SSIM
} vp8e_tuning;
VPX_TUNE_PSNR,
VPX_TUNE_SSIM
} vpx_tune_metric;
/*!\brief vp9 svc layer parameters
*
......@@ -789,7 +771,7 @@ VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
#define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
#define VPX_CTRL_VP8E_SET_ARNR_TYPE
VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vpx_tune_metric */
#define VPX_CTRL_VP8E_SET_TUNING
VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
#define VPX_CTRL_VP8E_SET_CQ_LEVEL
......@@ -832,7 +814,7 @@ VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
#define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vpx_tune_content */
#define VPX_CTRL_VP9E_SET_TUNE_CONTENT
VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int)
......
......@@ -28,24 +28,6 @@ extern "C" {
/* Include controls common to both the encoder and decoder */
#include "./vp8.h"
/*!\name Algorithm interface for VP8
*
* This interface provides the capability to decode VP8 streams.
* @{
*/
extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
extern vpx_codec_iface_t *vpx_codec_vp8_dx(void);
/*!@} - end algorithm interface member group*/
/*!\name Algorithm interface for VP9
*
* This interface provides the capability to decode VP9 streams.
* @{
*/
extern vpx_codec_iface_t vpx_codec_vp9_dx_algo;
extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
/*!@} - end algorithm interface member group*/
/*!\name Algorithm interface for VP10
*
* This interface provides the capability to decode VP10 streams.
......
......@@ -132,7 +132,7 @@
out0, out1, out2, out3); \
}
#define VP9_IADST4x4(in0, in1, in2, in3, out0, out1, out2, out3) { \
#define VPX_IADST4x4(in0, in1, in2, in3, out0, out1, out2, out3) { \
v8i16 res0_m, res1_m, c0_m, c1_m; \
v8i16 k1_m, k2_m, k3_m, k4_m; \
v8i16 zero_m = { 0 }; \
......
......@@ -33,7 +33,7 @@
* SPECIAL NOTES : None.
*
****************************************************************************/
void vp8_horizontal_line_5_4_scale_c(const unsigned char *source,
void vpx_horizontal_line_5_4_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
......@@ -64,7 +64,7 @@ void vp8_horizontal_line_5_4_scale_c(const unsigned char *source,
void vp8_vertical_band_5_4_scale_c(unsigned char *source,
void vpx_vertical_band_5_4_scale_c(unsigned char *source,
unsigned int src_pitch,
unsigned char *dest,
unsigned int dest_pitch,
......@@ -96,7 +96,7 @@ void vp8_vertical_band_5_4_scale_c(unsigned char *source,
/*7***************************************************************************
*
* ROUTINE : vp8_horizontal_line_3_5_scale_c
* ROUTINE : vpx_horizontal_line_3_5_scale_c
*
* INPUTS : const unsigned char *source : Pointer to source data.
* unsigned int source_width : Stride of source.
......@@ -114,7 +114,7 @@ void vp8_vertical_band_5_4_scale_c(unsigned char *source,
*
*
****************************************************************************/
void vp8_horizontal_line_5_3_scale_c(const unsigned char *source,
void vpx_horizontal_line_5_3_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
......@@ -142,7 +142,7 @@ void vp8_horizontal_line_5_3_scale_c(const unsigned char *source,
}
void vp8_vertical_band_5_3_scale_c(unsigned char *source,
void vpx_vertical_band_5_3_scale_c(unsigned char *source,
unsigned int src_pitch,
unsigned char *dest,
unsigned int dest_pitch,
......@@ -172,7 +172,7 @@ void vp8_vertical_band_5_3_scale_c(unsigned char *source,
/****************************************************************************
*
* ROUTINE : vp8_horizontal_line_1_2_scale_c
* ROUTINE : vpx_horizontal_line_1_2_scale_c
*
* INPUTS : const unsigned char *source : Pointer to source data.
* unsigned int source_width : Stride of source.
......@@ -189,7 +189,7 @@ void vp8_vertical_band_5_3_scale_c(unsigned char *source,
* SPECIAL NOTES : None.
*
****************************************************************************/
void vp8_horizontal_line_2_1_scale_c(const unsigned char *source,
void vpx_horizontal_line_2_1_scale_c(const unsigned char *source,
unsigned int source_width,
unsigned char *dest,
unsigned int dest_width) {
......@@ -208,7 +208,7 @@ void vp8_horizontal_line_2_1_scale_c(const unsigned char *source,
}
}
void vp8_vertical_band_2_1_scale_c(unsigned char *source,
void vpx_vertical_band_2_1_scale_c(unsigned char *source,
unsigned int src_pitch,
unsigned char *dest,
unsigned int dest_pitch,
......@@ -218,7 +218,7 @@ void vp8_vertical_band_2_1_scale_c(unsigned char *source,
memcpy(dest, source, dest_width);
}
void vp8_vertical_band_2_1_scale_i_c(unsigned char *source,
void vpx_vertical_band_2_1_scale_i_c(unsigned char *source,
unsigned int src_pitch,
unsigned char *dest,
unsigned int dest_pitch,
......
......@@ -289,15 +289,15 @@ void Scale2D
switch (hratio * 10 / hscale) {
case 8:
/* 4-5 Scale in Width direction */
horiz_line_scale = vp8_horizontal_line_5_4_scale;
horiz_line_scale = vpx_horizontal_line_5_4_scale;
break;
case 6:
/* 3-5 Scale in Width direction */
horiz_line_scale = vp8_horizontal_line_5_3_scale;
horiz_line_scale = vpx_horizontal_line_5_3_scale;
break;
case 5:
/* 1-2 Scale in Width direction */
horiz_line_scale = vp8_horizontal_line_2_1_scale;
horiz_line_scale = vpx_horizontal_line_2_1_scale;
break;
default:
/* The ratio is not acceptable now */
......@@ -309,13 +309,13 @@ void Scale2D
switch (vratio * 10 / vscale) {
case 8:
/* 4-5 Scale in vertical direction */
vert_band_scale = vp8_vertical_band_5_4_scale;
vert_band_scale = vpx_vertical_band_5_4_scale;
source_band_height = 5;
dest_band_height = 4;
break;
case 6:
/* 3-5 Scale in vertical direction */
vert_band_scale = vp8_vertical_band_5_3_scale;
vert_band_scale = vpx_vertical_band_5_3_scale;
source_band_height = 5;
dest_band_height = 3;
break;
......@@ -324,12 +324,12 @@ void Scale2D
if (interlaced) {
/* if the content is interlaced, point sampling is used */
vert_band_scale = vp8_vertical_band_2_1_scale;
vert_band_scale = vpx_vertical_band_2_1_scale;
} else {
interpolation = 1;
/* if the content is progressive, interplo */
vert_band_scale = vp8_vertical_band_2_1_scale_i;
vert_band_scale = vpx_vertical_band_2_1_scale_i;
}
......
......@@ -7,13 +7,13 @@ forward_decls qw/vpx_scale_forward_decls/;
# Scaler functions
if (vpx_config("CONFIG_SPATIAL_RESAMPLING") eq "yes") {
add_proto qw/void vp8_horizontal_line_5_4_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_5_4_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_horizontal_line_5_3_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_5_3_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_horizontal_line_2_1_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_2_1_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vpx_horizontal_line_5_4_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vpx_vertical_band_5_4_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vpx_horizontal_line_5_3_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vpx_vertical_band_5_3_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vpx_horizontal_line_2_1_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vpx_vertical_band_2_1_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vpx_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
}
add_proto qw/void vpx_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";
......
......@@ -339,8 +339,8 @@ static const arg_def_t arnr_strength = ARG_DEF(
static const arg_def_t arnr_type = ARG_DEF(
NULL, "arnr-type", 1, "AltRef type");
static const struct arg_enum_list tuning_enum[] = {
{"psnr", VP8_TUNE_PSNR},
{"ssim", VP8_TUNE_SSIM},
{"psnr", VPX_TUNE_PSNR},
{"ssim", VPX_TUNE_SSIM},
{NULL, 0}
};
static const arg_def_t tune_ssim = ARG_DEF_ENUM(
......@@ -414,8 +414,8 @@ static const arg_def_t inbitdeptharg = ARG_DEF(
#endif
static const struct arg_enum_list tune_content_enum[] = {
{"default", VP9E_CONTENT_DEFAULT},
{"screen", VP9E_CONTENT_SCREEN},
{"default", VPX_CONTENT_DEFAULT},
{"screen", VPX_CONTENT_SCREEN},
{NULL, 0}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment