Commit 378b1958 authored by Tom Finegan's avatar Tom Finegan

dump_obu: Add Section 5 bitstream support via obudec.

BUG=aomedia:1618

Change-Id: Iafd62a6c80a07e311926174350fe496aff4672f9
parent 66ae9163
......@@ -17,12 +17,17 @@
#include "./aom_config.h"
#include "./ivfdec.h"
#include "./obudec.h"
#include "tools/obu_parser.h"
#include "./tools_common.h"
#include "./webmdec.h"
namespace {
#if CONFIG_SCALABILITY
const int kIgnoreLayers = 8; // Used to ignore layer info in obudec.
#endif
const size_t kInitialBufferSize = 100 * 1024;
struct InputContext {
......@@ -31,12 +36,19 @@ 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
......@@ -50,6 +62,9 @@ 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
......@@ -66,6 +81,20 @@ 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
&ctx->unit_buffer_size, kIgnoreLayers
#else
&ctx->unit_buffer_size
#endif
)) {
return false;
}
break;
}
#endif
#if CONFIG_WEBM_IO
case FILE_TYPE_WEBM: {
size_t frame_size = ctx->unit_buffer_size;
......@@ -114,6 +143,10 @@ 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;
......
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