Commit 5082a369 authored by Adrian Grange's avatar Adrian Grange

Change "Vpx" to "Avx"

Change-Id: I0d1e439b75eb749dd80a86474ac5f494478d0360
parent 7df44f17
......@@ -43,8 +43,8 @@
static const char *exec_name;
struct VpxDecInputContext {
struct VpxInputContext *aom_input_ctx;
struct AvxDecInputContext {
struct AvxInputContext *aom_input_ctx;
struct WebmInputContext *webm_ctx;
};
......@@ -160,7 +160,7 @@ void usage_exit(void) {
fprintf(stderr, "\nIncluded decoders:\n\n");
for (i = 0; i < get_aom_decoder_count(); ++i) {
const VpxInterface *const decoder = get_aom_decoder_by_index(i);
const AvxInterface *const decoder = get_aom_decoder_by_index(i);
fprintf(stderr, " %-6s - %s\n", decoder->name,
aom_codec_iface_name(decoder->codec_interface()));
}
......@@ -213,7 +213,7 @@ static int raw_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read,
return 0;
}
static int read_frame(struct VpxDecInputContext *input, uint8_t **buf,
static int read_frame(struct AvxDecInputContext *input, uint8_t **buf,
size_t *bytes_in_buffer, size_t *buffer_size) {
switch (input->aom_input_ctx->file_type) {
#if CONFIG_WEBM_IO
......@@ -273,7 +273,7 @@ static void write_image_file(const aom_image_t *img, const int planes[3],
}
}
static int file_is_raw(struct VpxInputContext *input) {
static int file_is_raw(struct AvxInputContext *input) {
uint8_t buf[32];
int is_raw = 0;
aom_codec_stream_info_t si;
......@@ -285,7 +285,7 @@ static int file_is_raw(struct VpxInputContext *input) {
if (mem_get_le32(buf) < 256 * 1024 * 1024) {
for (i = 0; i < get_aom_decoder_count(); ++i) {
const VpxInterface *const decoder = get_aom_decoder_by_index(i);
const AvxInterface *const decoder = get_aom_decoder_by_index(i);
if (!aom_codec_peek_stream_info(decoder->codec_interface(), buf + 4,
32 - 4, &si)) {
is_raw = 1;
......@@ -476,8 +476,8 @@ static int main_loop(int argc, const char **argv_) {
int arg_skip = 0;
int ec_enabled = 0;
int keep_going = 0;
const VpxInterface *interface = NULL;
const VpxInterface *fourcc_interface = NULL;
const AvxInterface *interface = NULL;
const AvxInterface *fourcc_interface = NULL;
uint64_t dx_time = 0;
struct arg arg;
char **argv, **argi, **argj;
......@@ -508,8 +508,8 @@ static int main_loop(int argc, const char **argv_) {
MD5Context md5_ctx;
unsigned char md5_digest[16];
struct VpxDecInputContext input = { NULL, NULL };
struct VpxInputContext aom_input_ctx;
struct AvxDecInputContext input = { NULL, NULL };
struct AvxInputContext aom_input_ctx;
#if CONFIG_WEBM_IO
struct WebmInputContext webm_ctx;
memset(&(webm_ctx), 0, sizeof(webm_ctx));
......
......@@ -96,7 +96,7 @@ static void warn_or_exit_on_error(aom_codec_ctx_t *ctx, int fatal,
va_end(ap);
}
static int read_frame(struct VpxInputContext *input_ctx, aom_image_t *img) {
static int read_frame(struct AvxInputContext *input_ctx, aom_image_t *img) {
FILE *f = input_ctx->file;
y4m_input *y4m = &input_ctx->y4m;
int shortread = 0;
......@@ -501,7 +501,7 @@ void usage_exit(void) {
fprintf(stderr, "\nIncluded encoders:\n\n");
for (i = 0; i < num_encoder; ++i) {
const VpxInterface *const encoder = get_aom_encoder_by_index(i);
const AvxInterface *const encoder = get_aom_encoder_by_index(i);
const char *defstr = (i == (num_encoder - 1)) ? "(default)" : "";
fprintf(stderr, " %-6s - %s %s\n", encoder->name,
aom_codec_iface_name(encoder->codec_interface()), defstr);
......@@ -804,7 +804,7 @@ static void validate_positive_rational(const char *msg,
if (!rat->den) die("Error: %s has zero denominator\n", msg);
}
static void parse_global_config(struct VpxEncoderConfig *global, char **argv) {
static void parse_global_config(struct AvxEncoderConfig *global, char **argv) {
char **argi, **argj;
struct arg arg;
const int num_encoder = get_aom_encoder_count();
......@@ -917,7 +917,7 @@ static void parse_global_config(struct VpxEncoderConfig *global, char **argv) {
}
}
static void open_input_file(struct VpxInputContext *input) {
static void open_input_file(struct AvxInputContext *input) {
/* Parse certain options from the input file, if possible */
input->file = strcmp(input->filename, "-") ? fopen(input->filename, "rb")
: set_binary_mode(stdin);
......@@ -963,12 +963,12 @@ static void open_input_file(struct VpxInputContext *input) {
}
}
static void close_input_file(struct VpxInputContext *input) {
static void close_input_file(struct AvxInputContext *input) {
fclose(input->file);
if (input->file_type == FILE_TYPE_Y4M) y4m_input_close(&input->y4m);
}
static struct stream_state *new_stream(struct VpxEncoderConfig *global,
static struct stream_state *new_stream(struct AvxEncoderConfig *global,
struct stream_state *prev) {
struct stream_state *stream;
......@@ -1024,7 +1024,7 @@ static struct stream_state *new_stream(struct VpxEncoderConfig *global,
return stream;
}
static int parse_stream_params(struct VpxEncoderConfig *global,
static int parse_stream_params(struct AvxEncoderConfig *global,
struct stream_state *stream, char **argv) {
char **argi, **argj;
struct arg arg;
......@@ -1211,7 +1211,7 @@ static int parse_stream_params(struct VpxEncoderConfig *global,
} while (0)
static void validate_stream_config(const struct stream_state *stream,
const struct VpxEncoderConfig *global) {
const struct AvxEncoderConfig *global) {
const struct stream_state *streami;
(void)global;
......@@ -1280,7 +1280,7 @@ static void set_stream_dimensions(struct stream_state *stream, unsigned int w,
}
static void set_default_kf_interval(struct stream_state *stream,
struct VpxEncoderConfig *global) {
struct AvxEncoderConfig *global) {
/* Use a max keyframe interval of 5 seconds, if none was
* specified on the command line.
*/
......@@ -1315,8 +1315,8 @@ static const char *image_format_to_string(aom_img_fmt_t f) {
}
static void show_stream_config(struct stream_state *stream,
struct VpxEncoderConfig *global,
struct VpxInputContext *input) {
struct AvxEncoderConfig *global,
struct AvxInputContext *input) {
#define SHOW(field) \
fprintf(stderr, " %-28s = %d\n", #field, stream->config.cfg.field)
......@@ -1368,8 +1368,8 @@ static void show_stream_config(struct stream_state *stream,
}
static void open_output_file(struct stream_state *stream,
struct VpxEncoderConfig *global,
const struct VpxRational *pixel_aspect_ratio) {
struct AvxEncoderConfig *global,
const struct AvxRational *pixel_aspect_ratio) {
const char *fn = stream->config.out_fn;
const struct aom_codec_enc_cfg *const cfg = &stream->config.cfg;
......@@ -1418,7 +1418,7 @@ static void close_output_file(struct stream_state *stream,
}
static void setup_pass(struct stream_state *stream,
struct VpxEncoderConfig *global, int pass) {
struct AvxEncoderConfig *global, int pass) {
if (stream->config.stats_fn) {
if (!stats_open_file(&stream->stats, stream->config.stats_fn, pass))
fatal("Failed to open statistics store");
......@@ -1455,7 +1455,7 @@ static void setup_pass(struct stream_state *stream,
}
static void initialize_encoder(struct stream_state *stream,
struct VpxEncoderConfig *global) {
struct AvxEncoderConfig *global) {
int i;
int flags = 0;
......@@ -1485,14 +1485,14 @@ static void initialize_encoder(struct stream_state *stream,
#if CONFIG_DECODERS
if (global->test_decode != TEST_DECODE_OFF) {
const VpxInterface *decoder = get_aom_decoder_by_name(global->codec->name);
const AvxInterface *decoder = get_aom_decoder_by_name(global->codec->name);
aom_codec_dec_init(&stream->decoder, decoder->codec_interface(), NULL, 0);
}
#endif
}
static void encode_frame(struct stream_state *stream,
struct VpxEncoderConfig *global, struct aom_image *img,
struct AvxEncoderConfig *global, struct aom_image *img,
unsigned int frames_in) {
aom_codec_pts_t frame_start, next_frame_start;
struct aom_codec_enc_cfg *cfg = &stream->config.cfg;
......@@ -1591,7 +1591,7 @@ static void update_quantizer_histogram(struct stream_state *stream) {
}
static void get_cx_data(struct stream_state *stream,
struct VpxEncoderConfig *global, int *got_data) {
struct AvxEncoderConfig *global, int *got_data) {
const aom_codec_cx_pkt_t *pkt;
const struct aom_codec_enc_cfg *cfg = &stream->config.cfg;
aom_codec_iter_t iter = NULL;
......@@ -1709,7 +1709,7 @@ static float usec_to_fps(uint64_t usec, unsigned int frames) {
static void test_decode(struct stream_state *stream,
enum TestDecodeFatality fatal,
const VpxInterface *codec) {
const AvxInterface *codec) {
aom_image_t enc_img, dec_img;
struct av1_ref_frame ref_enc, ref_dec;
......@@ -1795,8 +1795,8 @@ int main(int argc, const char **argv_) {
#endif
int frame_avail, got_data;
struct VpxInputContext input;
struct VpxEncoderConfig global;
struct AvxInputContext input;
struct AvxEncoderConfig global;
struct stream_state *streams = NULL;
char **argv, **argi;
uint64_t cx_time = 0;
......
......@@ -31,11 +31,11 @@ typedef enum {
YV12, // 4:2:0 with uv flipped, only 8-bit depth
} ColorInputType;
struct VpxInterface;
struct AvxInterface;
/* Configuration elements common to all streams. */
struct VpxEncoderConfig {
const struct VpxInterface *codec;
struct AvxEncoderConfig {
const struct AvxInterface *codec;
int passes;
int pass;
int usage;
......
......@@ -463,7 +463,7 @@ static void set_temporal_layer_pattern(int layering_mode,
}
int main(int argc, char **argv) {
VpxVideoWriter *outfile[AOM_TS_MAX_LAYERS] = { NULL };
AvxVideoWriter *outfile[AOM_TS_MAX_LAYERS] = { NULL };
aom_codec_ctx_t codec;
aom_codec_enc_cfg_t cfg;
int frame_cnt = 0;
......@@ -486,7 +486,7 @@ int main(int argc, char **argv) {
#else
aom_svc_layer_id_t layer_id = { 0 };
#endif
const VpxInterface *encoder = NULL;
const AvxInterface *encoder = NULL;
FILE *infile = NULL;
struct RateControlMetrics rc;
int64_t cx_time = 0;
......@@ -650,7 +650,7 @@ int main(int argc, char **argv) {
// Open an output file for each stream.
for (i = 0; i < cfg.ts_number_layers; ++i) {
char file_name[PATH_MAX];
VpxVideoInfo info;
AvxVideoInfo info;
info.codec_fourcc = encoder->fourcc;
info.frame_width = cfg.g_w;
info.frame_height = cfg.g_h;
......
......@@ -80,9 +80,9 @@ int main(int argc, char **argv) {
int frame_cnt = 0;
FILE *outfile = NULL;
aom_codec_ctx_t codec;
VpxVideoReader *reader = NULL;
const VpxVideoInfo *info = NULL;
const VpxInterface *decoder = NULL;
AvxVideoReader *reader = NULL;
const AvxVideoInfo *info = NULL;
const AvxInterface *decoder = NULL;
exec_name = argv[0];
......
......@@ -75,9 +75,9 @@ int main(int argc, char **argv) {
int frame_cnt = 0;
FILE *outfile = NULL;
aom_codec_ctx_t codec;
const VpxInterface *decoder = NULL;
VpxVideoReader *reader = NULL;
const VpxVideoInfo *info = NULL;
const AvxInterface *decoder = NULL;
AvxVideoReader *reader = NULL;
const AvxVideoInfo *info = NULL;
int n = 0;
int m = 0;
int is_range = 0;
......
......@@ -124,7 +124,7 @@ static void unset_active_map(const aom_codec_enc_cfg_t *cfg,
}
static int encode_frame(aom_codec_ctx_t *codec, aom_image_t *img,
int frame_index, VpxVideoWriter *writer) {
int frame_index, AvxVideoWriter *writer) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
......@@ -158,9 +158,9 @@ int main(int argc, char **argv) {
int frame_count = 0;
aom_image_t raw;
aom_codec_err_t res;
VpxVideoInfo info;
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
AvxVideoInfo info;
AvxVideoWriter *writer = NULL;
const AvxInterface *encoder = NULL;
const int fps = 2; // TODO(dkovalev) add command line argument
const double bits_per_pixel_per_frame = 0.067;
......
......@@ -34,7 +34,7 @@
// Initializing The Codec
// ----------------------
// The libaom decoder is initialized by the call to aom_codec_dec_init().
// Determining the codec interface to use is handled by VpxVideoReader and the
// Determining the codec interface to use is handled by AvxVideoReader and the
// functions prefixed with aom_video_reader_. Discussion of those functions is
// beyond the scope of this example, but the main gist is to open the input file
// and parse just enough of it to determine if it's a VPx file and which VPx
......@@ -97,9 +97,9 @@ int main(int argc, char **argv) {
int frame_cnt = 0;
FILE *outfile = NULL;
aom_codec_ctx_t codec;
VpxVideoReader *reader = NULL;
const VpxInterface *decoder = NULL;
const VpxVideoInfo *info = NULL;
AvxVideoReader *reader = NULL;
const AvxInterface *decoder = NULL;
const AvxVideoInfo *info = NULL;
exec_name = argv[0];
......
......@@ -117,7 +117,7 @@ void usage_exit(void) {
}
static int encode_frame(aom_codec_ctx_t *codec, aom_image_t *img,
int frame_index, int flags, VpxVideoWriter *writer) {
int frame_index, int flags, AvxVideoWriter *writer) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
......@@ -150,9 +150,9 @@ int main(int argc, char **argv) {
int frame_count = 0;
aom_image_t raw;
aom_codec_err_t res;
VpxVideoInfo info = { 0 };
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
AvxVideoInfo info = { 0 };
AvxVideoWriter *writer = NULL;
const AvxInterface *encoder = NULL;
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
int keyframe_interval = 0;
......
......@@ -94,7 +94,7 @@ static int get_frame_stats(aom_codec_ctx_t *ctx, const aom_image_t *img,
static int encode_frame(aom_codec_ctx_t *ctx, const aom_image_t *img,
aom_codec_pts_t pts, unsigned int duration,
aom_enc_frame_flags_t flags, unsigned int deadline,
VpxVideoWriter *writer) {
AvxVideoWriter *writer) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
......@@ -120,7 +120,7 @@ static int encode_frame(aom_codec_ctx_t *ctx, const aom_image_t *img,
}
static aom_fixed_buf_t pass0(aom_image_t *raw, FILE *infile,
const VpxInterface *encoder,
const AvxInterface *encoder,
const aom_codec_enc_cfg_t *cfg) {
aom_codec_ctx_t codec;
int frame_count = 0;
......@@ -148,12 +148,12 @@ static aom_fixed_buf_t pass0(aom_image_t *raw, FILE *infile,
}
static void pass1(aom_image_t *raw, FILE *infile, const char *outfile_name,
const VpxInterface *encoder, const aom_codec_enc_cfg_t *cfg) {
VpxVideoInfo info = { encoder->fourcc,
const AvxInterface *encoder, const aom_codec_enc_cfg_t *cfg) {
AvxVideoInfo info = { encoder->fourcc,
cfg->g_w,
cfg->g_h,
{ cfg->g_timebase.num, cfg->g_timebase.den } };
VpxVideoWriter *writer = NULL;
AvxVideoWriter *writer = NULL;
aom_codec_ctx_t codec;
int frame_count = 0;
......@@ -191,7 +191,7 @@ int main(int argc, char **argv) {
aom_codec_err_t res;
aom_fixed_buf_t stats;
const VpxInterface *encoder = NULL;
const AvxInterface *encoder = NULL;
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
const char *const codec_arg = argv[1];
......
......@@ -38,7 +38,7 @@ static void fix_framerate(int *num, int *den) {
}
}
int file_is_ivf(struct VpxInputContext *input_ctx) {
int file_is_ivf(struct AvxInputContext *input_ctx) {
char raw_hdr[32];
int is_ivf = 0;
......
......@@ -17,7 +17,7 @@
extern "C" {
#endif
int file_is_ivf(struct VpxInputContext *input);
int file_is_ivf(struct AvxInputContext *input);
int ivf_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read,
size_t *buffer_size);
......
......@@ -54,15 +54,15 @@ const EncodeParameters kAV1EncodeParameterSet[] = {
// TODO(JBB): Test profiles (requires more work).
};
class VpxEncoderParmsGetToDecoder
class AvxEncoderParmsGetToDecoder
: public ::libaom_test::EncoderTest,
public ::libaom_test::CodecTestWith2Params<EncodeParameters,
EncodePerfTestVideo> {
protected:
VpxEncoderParmsGetToDecoder()
AvxEncoderParmsGetToDecoder()
: EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {}
virtual ~VpxEncoderParmsGetToDecoder() {}
virtual ~AvxEncoderParmsGetToDecoder() {}
virtual void SetUp() {
InitializeConfig();
......@@ -134,7 +134,7 @@ class VpxEncoderParmsGetToDecoder
EncodeParameters encode_parms;
};
TEST_P(VpxEncoderParmsGetToDecoder, BitstreamParms) {
TEST_P(AvxEncoderParmsGetToDecoder, BitstreamParms) {
init_flags_ = AOM_CODEC_USE_PSNR;
libaom_test::VideoSource *const video =
......@@ -145,7 +145,7 @@ TEST_P(VpxEncoderParmsGetToDecoder, BitstreamParms) {
delete video;
}
AV1_INSTANTIATE_TEST_CASE(VpxEncoderParmsGetToDecoder,
AV1_INSTANTIATE_TEST_CASE(AvxEncoderParmsGetToDecoder,
::testing::ValuesIn(kAV1EncodeParameterSet),
::testing::ValuesIn(kAV1EncodePerfTestVectors));
} // namespace
......@@ -28,7 +28,7 @@
namespace {
typedef void (*VpxPredFunc)(uint8_t *dst, ptrdiff_t y_stride,
typedef void (*AvxPredFunc)(uint8_t *dst, ptrdiff_t y_stride,
const uint8_t *above, const uint8_t *left);
const int kNumAv1IntraPredFuncs = 13;
......@@ -38,7 +38,7 @@ const char *kAv1IntraPredNames[kNumAv1IntraPredFuncs] = {
"D207_PRED", "D63_PRED", "TM_PRED"
};
void TestIntraPred(const char name[], VpxPredFunc const *pred_funcs,
void TestIntraPred(const char name[], AvxPredFunc const *pred_funcs,
const char *const pred_func_names[], int num_funcs,
const char *const signatures[], int block_size,
int num_pixels_per_test) {
......@@ -81,7 +81,7 @@ void TestIntraPred(const char name[], VpxPredFunc const *pred_funcs,
}
}
void TestIntraPred4(VpxPredFunc const *pred_funcs) {
void TestIntraPred4(AvxPredFunc const *pred_funcs) {
static const int kNumAv1IntraFuncs = 13;
static const char *const kSignatures[kNumAv1IntraFuncs] = {
"4334156168b34ab599d9b5b30f522fe9", "bc4649d5ba47c7ff178d92e475960fb0",
......@@ -96,7 +96,7 @@ void TestIntraPred4(VpxPredFunc const *pred_funcs) {
kSignatures, 4, 4 * 4 * kNumAv1IntraFuncs);
}
void TestIntraPred8(VpxPredFunc const *pred_funcs) {
void TestIntraPred8(AvxPredFunc const *pred_funcs) {
static const int kNumAv1IntraFuncs = 13;
static const char *const kSignatures[kNumAv1IntraFuncs] = {
"7694ddeeefed887faf9d339d18850928", "7d726b1213591b99f736be6dec65065b",
......@@ -111,7 +111,7 @@ void TestIntraPred8(VpxPredFunc const *pred_funcs) {
kSignatures, 8, 8 * 8 * kNumAv1IntraFuncs);
}
void TestIntraPred16(VpxPredFunc const *pred_funcs) {
void TestIntraPred16(AvxPredFunc const *pred_funcs) {
static const int kNumAv1IntraFuncs = 13;
static const char *const kSignatures[kNumAv1IntraFuncs] = {
"b40dbb555d5d16a043dc361e6694fe53", "fb08118cee3b6405d64c1fd68be878c6",
......@@ -126,7 +126,7 @@ void TestIntraPred16(VpxPredFunc const *pred_funcs) {
kSignatures, 16, 16 * 16 * kNumAv1IntraFuncs);
}
void TestIntraPred32(VpxPredFunc const *pred_funcs) {
void TestIntraPred32(AvxPredFunc const *pred_funcs) {
static const int kNumAv1IntraFuncs = 13;
static const char *const kSignatures[kNumAv1IntraFuncs] = {
"558541656d84f9ae7896db655826febe", "b3587a1f9a01495fa38c8cd3c8e2a1bf",
......@@ -148,7 +148,7 @@ void TestIntraPred32(VpxPredFunc const *pred_funcs) {
#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
d45, d135, d117, d153, d207, d63, tm) \
TEST(arch, test_func) { \
static const VpxPredFunc aom_intra_pred[] = { \
static const AvxPredFunc aom_intra_pred[] = { \
dc, dc_left, dc_top, dc_128, v, h, d45, d135, d117, d153, d207, d63, tm \
}; \
test_func(aom_intra_pred); \
......
This diff is collapsed.
......@@ -26,7 +26,7 @@ namespace libaom_test {
class WebMVideoSource : public CompressedVideoSource {
public:
explicit WebMVideoSource(const std::string &file_name)
: file_name_(file_name), aom_ctx_(new VpxInputContext()),
: file_name_(file_name), aom_ctx_(new AvxInputContext()),
webm_ctx_(new WebmInputContext()), buf_(NULL), buf_sz_(0), frame_(0),
end_of_file_(false) {}
......@@ -81,7 +81,7 @@ class WebMVideoSource : public CompressedVideoSource {
protected:
std::string file_name_;
VpxInputContext *aom_ctx_;
AvxInputContext *aom_ctx_;
WebmInputContext *webm_ctx_;
uint8_t *buf_;
size_t buf_sz_;
......
......@@ -159,7 +159,7 @@ class Y4mVideoWriteTest : public Y4mVideoSourceTest {
void WriteY4mAndReadBack() {
ASSERT_TRUE(input_file_ != NULL);
char buf[Y4M_BUFFER_SIZE] = { 0 };
const struct VpxRational framerate = { y4m_.fps_n, y4m_.fps_d };
const struct AvxRational framerate = { y4m_.fps_n, y4m_.fps_d };
tmpfile_ = new libaom_test::TempOutFile;
ASSERT_TRUE(tmpfile_->file() != NULL);
y4m_write_file_header(buf, sizeof(buf), kWidth, kHeight, &framerate,
......
......@@ -75,7 +75,7 @@ void die_codec(aom_codec_ctx_t *ctx, const char *s) {
exit(EXIT_FAILURE);
}
int read_yuv_frame(struct VpxInputContext *input_ctx, aom_image_t *yuv_frame) {
int read_yuv_frame(struct AvxInputContext *input_ctx, aom_image_t *yuv_frame) {
FILE *f = input_ctx->file;
struct FileTypeDetectionBuffer *detect = &input_ctx->detect;
int plane = 0;
......@@ -130,7 +130,7 @@ int read_yuv_frame(struct VpxInputContext *input_ctx, aom_image_t *yuv_frame) {
#if CONFIG_ENCODERS
static const VpxInterface aom_encoders[] = {
static const AvxInterface aom_encoders[] = {
#if CONFIG_AV1_ENCODER
{ "av1", AV1_FOURCC, &aom_codec_av1_cx },
#endif
......@@ -140,13 +140,13 @@ int get_aom_encoder_count(void) {
return sizeof(aom_encoders) / sizeof(aom_encoders[0]);
}
const VpxInterface *get_aom_encoder_by_index(int i) { return &aom_encoders[i]; }
const AvxInterface *get_aom_encoder_by_index(int i) { return &aom_encoders[i]; }
const VpxInterface *get_aom_encoder_by_name(const char *name) {
const AvxInterface *get_aom_encoder_by_name(const char *name) {
int i;
for (i = 0; i < get_aom_encoder_count(); ++i) {
const VpxInterface *encoder = get_aom_encoder_by_index(i);
const AvxInterface *encoder = get_aom_encoder_by_index(i);
if (strcmp(encoder->name, name) == 0) return encoder;
}
......@@ -157,7 +157,7 @@ const VpxInterface *get_aom_encoder_by_name(const char *name) {
#if CONFIG_DECODERS
static const VpxInterface aom_decoders[] = {
static const AvxInterface aom_decoders[] = {
#if CONFIG_AV1_DECODER
{ "av1", AV1_FOURCC, &aom_codec_av1_dx },
#endif
......@@ -167,24 +167,24 @@ int get_aom_decoder_count(void) {
return sizeof(aom_decoders) / sizeof(aom_decoders[0]);
}
const VpxInterface *get_aom_decoder_by_index(int i) { return &aom_decoders[i]; }
const AvxInterface *get_aom_decoder_by_index(int i) { return &aom_decoders[i]; }
const VpxInterface *get_aom_decoder_by_name(const char *name) {
const AvxInterface *get_aom_decoder_by_name(const char *name) {
int i;
for (i = 0; i < get_aom_decoder_count(); ++i) {
const VpxInterface *const decoder = get_aom_decoder_by_index(i);
const AvxInterface *const decoder = get_aom_decoder_by_index(i);
if (strcmp(decoder->name, name) == 0) return decoder;
}
return NULL;
}
const VpxInterface *get_aom_decoder_by_fourcc(uint32_t fourcc) {
const AvxInterface *get_aom_decoder_by_fourcc(uint32_t fourcc) {
int i;
for (i = 0; i < get_aom_decoder_count(); ++i) {
const VpxInterface *const decoder = get_aom_decoder_by_index(i);
const AvxInterface *const decoder = get_aom_decoder_by_index(i);
if (decoder->fourcc == fourcc) return decoder;
}
......
......@@ -76,12 +76,12 @@ struct FileTypeDetectionBuffer {
size_t position;
};
struct VpxRational {
struct AvxRational {
int numerator;
int denominator;
};
struct VpxInputContext {
struct AvxInputContext {
const char *filename;
FILE *file;
int64_t length;
......@@ -89,12 +89,12 @@ struct VpxInputContext {
enum VideoFileType file_type;
uint32_t width;
uint32_t height;
struct VpxRational pixel_aspect_ratio;
struct AvxRational pixel_aspect_ratio;
aom_img_fmt_t fmt;
aom_bit_depth_t bit_depth;
int only_i420;
uint32_t fourcc;
struct VpxRational framerate;
struct AvxRational framerate;
#if CONFIG_ENCODERS
y4m_input y4m;
#endif
......@@ -124,22 +124,22 @@ void usage_exit(void) AOM_NO_RETURN;
#undef AOM_NO_RETURN
int read_yuv_frame(struct VpxInputContext *input_ctx, aom_image_t *yuv_frame);
int read_yuv_frame(struct AvxInputContext *input_ctx, aom_image_t *yuv_frame);
typedef struct VpxInterface {
typedef struct AvxInterface {
const char *const name;
const uint32_t fourcc;
aom_codec_iface_t *(*const codec_interface)();
} VpxInterface;
} AvxInterface;
int get_aom_encoder_count(void);
const VpxInterface *get_aom_encoder_by_index(int i);
const VpxInterface *get_aom_encoder_by_name(const char *name);
const AvxInterface *get_aom_encoder_by_index(int i);
const AvxInterface *get_aom_encoder_by_name(const char *name);
int get_aom_decoder_count(void);
const VpxInterface *get_aom_decoder_by_index(int i);
const VpxInterface *get_aom_decoder_by_name(const char *name);
const VpxInterface *get_aom_decoder_by_fourcc(uint32_t fourcc);
const AvxInterface *get_aom_decoder_by_index(int i);
const AvxInterface *get_aom_decoder_by_name(const char *name);
const AvxInterface *get_aom_decoder_by_fourcc(uint32_t fourcc);
// TODO(dkovalev): move this function to aom_image.{c, h}, so it will be part
// of aom_image_t support
......
......@@ -18,7 +18,7 @@ typedef struct {
uint32_t codec_fourcc;
int frame_width;
int frame_height;
struct VpxRational time_base;
} VpxVideoInfo;
struct AvxRational time_base;
} AvxVideoInfo;
#endif // VIDEO_COMMON_H_
......@@ -19,17 +19,17 @@
static const char *const kIVFSignature = "DKIF";
struct VpxVideoReaderStruct {
VpxVideoInfo info;
struct AvxVideoReaderStruct {
AvxVideoInfo info;
FILE *file;
uint8_t *buffer;
size_t buffer_size;
size_t frame_size;
};
VpxVideoReader *aom_video_reader_open(const char *filename) {
AvxVideoReader *aom_video_reader_open(const char *filename) {
char header[32];
VpxVideoReader *reader = NULL;
AvxVideoReader *reader = NULL;
FILE *const file = fopen(filename, "rb");
if (!file) return NULL; // Can't open file
......@@ -41,7 +41,7 @@ VpxVideoReader *aom_video_reader_open(const char *filename) {
if (mem_get_le16(header + 4) != 0) return NULL; // Wrong IVF version
reader = calloc(1, sizeof(*reader));
if (!reader) return NULL; // Can't allocate VpxVideoReader
if (!reader) return NULL; // Can't allocate AvxVideoReader
reader->file = file;
reader->info.codec_fourcc = mem_get_le32(header + 8);
......@@ -53,7 +53,7 @@ VpxVideoReader *aom_video_reader_open(const char *filename) {
return reader;
}
void aom_video_reader_close(VpxVideoReader *reader) {
void aom_video_reader_close(AvxVideoReader *reader) {
if (reader) {