Commit 61b71abc authored by Tom Finegan's avatar Tom Finegan

Remove CONFIG_OBU_NO_IVF macros.

Enable all the code previously protected, and clean up the
stale code.

Change-Id: Iff0f62db4f46fbd662c120b5e1e696b61d3e2d95
parent 378b1958
......@@ -171,13 +171,11 @@ set(AOM_COMMON_APP_UTIL_SOURCES
set(AOM_DECODER_APP_UTIL_SOURCES
"${AOM_ROOT}/ivfdec.c"
"${AOM_ROOT}/ivfdec.h"
"${AOM_ROOT}/obudec.c"
"${AOM_ROOT}/obudec.h"
"${AOM_ROOT}/video_reader.c"
"${AOM_ROOT}/video_reader.h")
if (CONFIG_OBU_NO_IVF)
list(APPEND AOM_DECODER_APP_UTIL_SOURCES "${AOM_ROOT}/obudec.c" "${AOM_ROOT}/obudec.h")
endif ()
set(AOM_ENCODER_APP_UTIL_SOURCES
"${AOM_ROOT}/ivfenc.c"
"${AOM_ROOT}/ivfenc.h"
......@@ -313,9 +311,7 @@ if (CONFIG_UNIT_TESTS OR ENABLE_EXAMPLES OR ENABLE_TOOLS)
if (CONFIG_AV1_DECODER)
add_library(aom_decoder_app_util OBJECT ${AOM_DECODER_APP_UTIL_SOURCES})
# obudec depends on internal headers that require *rtcd.h
if (CONFIG_OBU_NO_IVF)
add_dependencies(aom_decoder_app_util aom_rtcd)
endif ()
add_dependencies(aom_decoder_app_util aom_rtcd)
endif ()
if (CONFIG_AV1_ENCODER)
add_library(aom_encoder_app_util OBJECT ${AOM_ENCODER_APP_UTIL_SOURCES})
......
......@@ -42,12 +42,9 @@
#endif
#include "./md5_utils.h"
#if CONFIG_OBU_NO_IVF
#include "./obudec.h"
#endif
#include "./tools_common.h"
#if CONFIG_WEBM_IO
#include "./webmdec.h"
#endif
......@@ -245,7 +242,6 @@ static int read_frame(struct AvxDecInputContext *input, uint8_t **buf,
case FILE_TYPE_IVF:
return ivf_read_frame(input->aom_input_ctx->file, buf, bytes_in_buffer,
buffer_size);
#if CONFIG_OBU_NO_IVF
case FILE_TYPE_OBU:
return obudec_read_temporal_unit(input->obu_ctx, buf,
#if CONFIG_SCALABILITY
......@@ -254,7 +250,6 @@ static int read_frame(struct AvxDecInputContext *input, uint8_t **buf,
bytes_in_buffer, buffer_size
#endif
);
#endif
default: return 1;
}
}
......@@ -537,11 +532,9 @@ static int main_loop(int argc, const char **argv_) {
memset(&webm_ctx, 0, sizeof(webm_ctx));
input.webm_ctx = &webm_ctx;
#endif
#if CONFIG_OBU_NO_IVF
struct ObuDecInputContext obu_ctx = { NULL, NULL, 0, 0 };
obu_ctx.avx_ctx = &aom_input_ctx;
input.obu_ctx = &obu_ctx;
#endif
input.aom_input_ctx = &aom_input_ctx;
/* Parse command line */
......@@ -661,10 +654,8 @@ static int main_loop(int argc, const char **argv_) {
else if (file_is_webm(input.webm_ctx, input.aom_input_ctx))
input.aom_input_ctx->file_type = FILE_TYPE_WEBM;
#endif
#if CONFIG_OBU_NO_IVF
else if (file_is_obu(&obu_ctx))
input.aom_input_ctx->file_type = FILE_TYPE_OBU;
#endif
else if (file_is_raw(input.aom_input_ctx))
input.aom_input_ctx->file_type = FILE_TYPE_RAW;
else {
......@@ -1032,10 +1023,8 @@ fail2:
if (input.aom_input_ctx->file_type == FILE_TYPE_WEBM)
webm_free(input.webm_ctx);
#endif
#if CONFIG_OBU_NO_IVF
if (input.aom_input_ctx->file_type == FILE_TYPE_OBU)
obudec_free(input.obu_ctx);
#endif
if (input.aom_input_ctx->file_type != FILE_TYPE_WEBM) free(buf);
......
......@@ -184,9 +184,7 @@ static const arg_def_t framerate =
static const arg_def_t use_webm =
ARG_DEF(NULL, "webm", 0, "Output WebM (default when WebM IO is enabled)");
static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0, "Output IVF");
#if CONFIG_OBU_NO_IVF
static const arg_def_t use_obu = ARG_DEF(NULL, "obu", 0, "Output OBU");
#endif
static const arg_def_t out_part =
ARG_DEF("P", "output-partitions", 0,
"Makes encoder output partitions. Requires IVF output!");
......@@ -228,9 +226,7 @@ static const arg_def_t *main_args[] = { &help,
&psnrarg,
&use_webm,
&use_ivf,
#if CONFIG_OBU_NO_IVF
&use_obu,
#endif
&out_part,
&q_hist_n,
&rate_hist_n,
......@@ -802,9 +798,7 @@ struct stream_config {
int arg_ctrl_cnt;
int write_webm;
const char *film_grain_filename;
#if CONFIG_OBU_NO_IVF
int write_ivf;
#endif
// whether to use 16bit internal buffers
int use_16bit_internal;
};
......@@ -1053,9 +1047,7 @@ static struct stream_state *new_stream(struct AvxEncoderConfig *global,
/* Initialize remaining stream parameters */
stream->config.write_webm = 1;
#if CONFIG_OBU_NO_IVF
stream->config.write_ivf = 0;
#endif
#if CONFIG_WEBM_IO
stream->config.stereo_fmt = STEREO_FORMAT_MONO;
stream->webm_ctx.last_pts_ns = -1;
......@@ -1137,17 +1129,12 @@ static int parse_stream_params(struct AvxEncoderConfig *global,
if (out_fn_len >= 4 &&
!strcmp(config->out_fn + out_fn_len - 4, ".ivf")) {
config->write_webm = 0;
#if CONFIG_OBU_NO_IVF
config->write_ivf = 1;
#endif
}
#if CONFIG_OBU_NO_IVF
else if (out_fn_len >= 4 &&
!strcmp(config->out_fn + out_fn_len - 4, ".obu")) {
} else if (out_fn_len >= 4 &&
!strcmp(config->out_fn + out_fn_len - 4, ".obu")) {
config->write_webm = 0;
config->write_ivf = 0;
}
#endif
}
} else if (arg_match(&arg, &fpf_name, argi)) {
config->stats_fn = arg.val;
......@@ -1164,14 +1151,10 @@ static int parse_stream_params(struct AvxEncoderConfig *global,
#endif
} else if (arg_match(&arg, &use_ivf, argi)) {
config->write_webm = 0;
#if CONFIG_OBU_NO_IVF
config->write_ivf = 1;
#endif
#if CONFIG_OBU_NO_IVF
} else if (arg_match(&arg, &use_obu, argi)) {
config->write_webm = 0;
config->write_ivf = 0;
#endif
} else if (arg_match(&arg, &threads, argi)) {
config->cfg.g_threads = arg_parse_uint(&arg);
} else if (arg_match(&arg, &profile, argi)) {
......@@ -1473,11 +1456,7 @@ static void open_output_file(struct stream_state *stream,
(void)pixel_aspect_ratio;
#endif
if (!stream->config.write_webm
#if CONFIG_OBU_NO_IVF
&& stream->config.write_ivf
#endif
) {
if (!stream->config.write_webm && stream->config.write_ivf) {
ivf_write_file_header(stream->file, cfg, global->codec->fourcc, 0);
}
}
......@@ -1494,11 +1473,7 @@ static void close_output_file(struct stream_state *stream,
}
#endif
if (!stream->config.write_webm
#if CONFIG_OBU_NO_IVF
&& stream->config.write_ivf
#endif
) {
if (!stream->config.write_webm && stream->config.write_ivf) {
if (!fseek(stream->file, 0, SEEK_SET))
ivf_write_file_header(stream->file, &stream->config.cfg, fourcc,
stream->frames_out);
......@@ -1720,9 +1695,7 @@ static void get_cx_data(struct stream_state *stream,
}
#endif
if (!stream->config.write_webm) {
#if CONFIG_OBU_NO_IVF
if (stream->config.write_ivf) {
#endif
if (pkt->data.frame.partition_id <= 0) {
ivf_header_pos = ftello(stream->file);
fsize = pkt->data.frame.sz;
......@@ -1738,9 +1711,7 @@ static void get_cx_data(struct stream_state *stream,
fseeko(stream->file, currpos, SEEK_SET);
}
}
#if CONFIG_OBU_NO_IVF
}
#endif
(void)fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
stream->file);
......@@ -2112,16 +2083,8 @@ int main(int argc, const char **argv_) {
FOREACH_STREAM(stream, streams) {
if (stream->config.write_webm) {
stream->config.write_webm = 0;
#if CONFIG_OBU_NO_IVF
stream->config.write_ivf = 0;
#endif
warn(
"aomenc was compiled without WebM container support."
#if CONFIG_OBU_NO_IVF
"Producing OBU output");
#else
"Producing IVF output");
#endif
warn("aomenc compiled w/o WebM support. Writing OBU stream.");
}
}
#endif
......
......@@ -104,7 +104,6 @@ set(CONFIG_INTER_STATS_ONLY 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_LOWPRECISION_BLEND 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_MONO_VIDEO 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU_FRAME 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU_NO_IVF 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU_REDUNDANT_FRAME_HEADER 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OPERATING_POINTS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_RD_DEBUG 0 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -20,12 +20,6 @@ macro (fix_experiment_configs)
endif ()
endif ()
if (CONFIG_SCALABILITY)
if (NOT CONFIG_OBU_NO_IVF)
change_config_and_warn(CONFIG_OBU_NO_IVF 1 CONFIG_SCALABILITY)
endif ()
endif ()
if (CONFIG_ANALYZER)
if (NOT CONFIG_INSPECTION)
change_config_and_warn(CONFIG_INSPECTION 1 CONFIG_ANALYZER)
......
......@@ -27,8 +27,6 @@
#define OBU_DETECTION_SIZE \
(OBU_HEADER_SIZE + OBU_EXTENSION_SIZE + OBU_MAX_LENGTH_FIELD_SIZE)
#if CONFIG_OBU_NO_IVF
// Reads unsigned LEB128 integer and returns 0 upon successful read and decode.
// Stores raw bytes in 'value_buffer', length of the number in 'value_length',
// and decoded value in 'value'.
......@@ -297,5 +295,3 @@ int obudec_read_temporal_unit(struct ObuDecInputContext *obu_ctx,
}
void obudec_free(struct ObuDecInputContext *obu_ctx) { free(obu_ctx->buffer); }
#endif // CONFIG_OBU_NO_IVF
......@@ -36,19 +36,15 @@ struct InputContext {
void Init() {
memset(avx_ctx, 0, sizeof(*avx_ctx));
#if CONFIG_OBU_NO_IVF
memset(obu_ctx, 0, sizeof(*obu_ctx));
obu_ctx->avx_ctx = avx_ctx;
#endif // CONFIG_OBU_NO_IVF
#if CONFIG_WEBM_IO
memset(webm_ctx, 0, sizeof(*webm_ctx));
#endif
}
AvxInputContext *avx_ctx = nullptr;
#if CONFIG_OBU_NO_IVF
ObuDecInputContext *obu_ctx = nullptr;
#endif
#if CONFIG_WEBM_IO
WebmInputContext *webm_ctx = nullptr;
#endif
......@@ -62,9 +58,7 @@ void PrintUsage() {
VideoFileType GetFileType(InputContext *ctx) {
if (file_is_ivf(ctx->avx_ctx)) return FILE_TYPE_IVF;
#if CONFIG_OBU_NO_IVF
if (file_is_obu(ctx->obu_ctx)) return FILE_TYPE_OBU;
#endif
#if CONFIG_WEBM_IO
if (file_is_webm(ctx->webm_ctx, ctx->avx_ctx)) return FILE_TYPE_WEBM;
#endif
......@@ -81,7 +75,6 @@ bool ReadTemporalUnit(InputContext *ctx, size_t *unit_size) {
}
break;
}
#if CONFIG_OBU_NO_IVF
case FILE_TYPE_OBU: {
if (obudec_read_temporal_unit(ctx->obu_ctx, &ctx->unit_buffer, unit_size,
#if CONFIG_SCALABILITY
......@@ -94,7 +87,6 @@ bool ReadTemporalUnit(InputContext *ctx, size_t *unit_size) {
}
break;
}
#endif
#if CONFIG_WEBM_IO
case FILE_TYPE_WEBM: {
size_t frame_size = ctx->unit_buffer_size;
......@@ -143,10 +135,8 @@ int main(int argc, const char *argv[]) {
AvxInputContext avx_ctx;
InputContext input_ctx;
input_ctx.avx_ctx = &avx_ctx;
#if CONFIG_OBU_NO_IVF
ObuDecInputContext obu_ctx;
input_ctx.obu_ctx = &obu_ctx;
#endif
#if CONFIG_WEBM_IO
WebmInputContext webm_ctx;
input_ctx.webm_ctx = &webm_ctx;
......
......@@ -69,9 +69,7 @@ typedef long FileOffset; /* NOLINT */
#define AV1_FOURCC 0x31305641
enum VideoFileType {
#if CONFIG_OBU_NO_IVF
FILE_TYPE_OBU,
#endif
FILE_TYPE_RAW,
FILE_TYPE_IVF,
FILE_TYPE_Y4M,
......
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