#include "./tools_common.h" #if CONFIG_WEBM_IO #include "./webmdec.h" #endif #include "./y4menc.h" static const char *exec_name; struct AvxDecInputContext { struct AvxInputContext *aom_input_ctx; struct WebmInputContext *webm_ctx; }; static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1, "Number of times to decode the file"); static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1, "Codec to use"); static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0, "Output raw YV12 frames"); static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0, "Output raw I420 frames"); static const arg_def_t flipuvarg = ARG_DEF(NULL, "flipuv", 0, "Flip the chroma planes in the output"); static const arg_def_t rawvideo = ARG_DEF(NULL, "rawvideo", 0, "Output raw YUV frames"); static const arg_def_t noblitarg = ARG_DEF(NULL, "noblit", 0, "Don't process the decoded frames"); static const arg_def_t progressarg = ARG_DEF(NULL, "progress", 0, "Show progress after each frame decodes"); static const arg_def_t limitarg = ARG_DEF(NULL, "limit", 1, "Stop decoding after n frames");
static const struct { char const *name; const vpx_codec_iface_t *(*iface)(void); unsigned int fourcc; unsigned int fourcc_mask; } ifaces[] = { #if CONFIG_VP8_DECODER {"vp8", vpx_codec_vp8_dx, VP8_FOURCC, 0x00FFFFFF}, #endif #if CONFIG_VP9_DECODER {"vp9", vpx_codec_vp9_dx, VP9_FOURCC, 0x00FFFFFF}, #endif }; #include "args.h" static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1, "Number of times to decode the file"); static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1, "Codec to use"); static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0, "Output raw YV12 frames"); static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0, "Output raw I420 frames"); static const arg_def_t flipuvarg = ARG_DEF(NULL, "flipuv", 0, "Flip the chroma planes in the output"); static const arg_def_t noblitarg = ARG_DEF(NULL, "noblit", 0, "Don't process the decoded frames"); static const arg_def_t progressarg = ARG_DEF(NULL, "progress", 0, "Show progress after each frame decodes"); static const arg_def_t limitarg = ARG_DEF(NULL, "limit", 1, "Stop decoding after n frames"); static const arg_def_t skiparg = ARG_DEF(NULL, "skip", 1,
#include "vpx/svc_context.h" #include "vpx/vp8cx.h" #include "vpx/vpx_encoder.h" static const struct arg_enum_list encoding_mode_enum[] = { {"i", INTER_LAYER_PREDICTION_I}, {"alt-ip", ALT_INTER_LAYER_PREDICTION_IP}, {"ip", INTER_LAYER_PREDICTION_IP}, {"gf", USE_GOLDEN_FRAME}, {NULL, 0} }; static const arg_def_t encoding_mode_arg = ARG_DEF_ENUM( "m", "encoding-mode", 1, "Encoding mode algorithm", encoding_mode_enum); static const arg_def_t skip_frames_arg = ARG_DEF("s", "skip-frames", 1, "input frames to skip"); static const arg_def_t frames_arg = ARG_DEF("f", "frames", 1, "number of frames to encode"); static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width"); static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height"); static const arg_def_t timebase_arg = ARG_DEF("t", "timebase", 1, "timebase (num/den)"); static const arg_def_t bitrate_arg = ARG_DEF( "b", "target-bitrate", 1, "encoding bitrate, in kilobits per second"); static const arg_def_t layers_arg = ARG_DEF("l", "layers", 1, "number of SVC layers"); static const arg_def_t kf_dist_arg = ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes"); static const arg_def_t scale_factors_arg = ARG_DEF("r", "scale-factors", 1, "scale factors (lowest to highest layer)"); static const arg_def_t quantizers_arg =
#include <stdarg.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "./args.h" #include "./tools_common.h" #include "./video_writer.h" #include "vpx/svc_context.h" #include "vpx/vp8cx.h" #include "vpx/vpx_encoder.h" #include "./vpxstats.h" static const arg_def_t skip_frames_arg = ARG_DEF("s", "skip-frames", 1, "input frames to skip"); static const arg_def_t frames_arg = ARG_DEF("f", "frames", 1, "number of frames to encode"); static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width"); static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height"); static const arg_def_t timebase_arg = ARG_DEF("t", "timebase", 1, "timebase (num/den)"); static const arg_def_t bitrate_arg = ARG_DEF( "b", "target-bitrate", 1, "encoding bitrate, in kilobits per second"); static const arg_def_t spatial_layers_arg = ARG_DEF("sl", "spatial-layers", 1, "number of spatial SVC layers"); static const arg_def_t temporal_layers_arg = ARG_DEF("tl", "temporal-layers", 1, "number of temporal SVC layers"); static const arg_def_t kf_dist_arg = ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes"); static const arg_def_t scale_factors_arg =
vpx_codec_pts_t pts; if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return; pts = pkt->data.frame.pts; mem_put_le32(header, pkt->data.frame.sz); mem_put_le32(header + 4, pts & 0xFFFFFFFF); mem_put_le32(header + 8, pts >> 32); fwrite(header, 1, 12, outfile); } #include "args.h" static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0, "Input file is YV12 "); static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0, "Input file is I420 (default)"); static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1, "Codec to use"); static const arg_def_t passes = ARG_DEF("p", "passes", 1, "Number of passes (1/2)"); static const arg_def_t pass_arg = ARG_DEF(NULL, "pass", 1, "Pass to execute (1/2)"); static const arg_def_t fpf_name = ARG_DEF(NULL, "fpf", 1, "First pass statistics file name"); static const arg_def_t limit = ARG_DEF(NULL, "limit", 1, "Stop encoding after n input frames"); static const arg_def_t deadline = ARG_DEF("d", "deadline", 1, "Deadline per frame (usec)"); static const arg_def_t best_dl = ARG_DEF(NULL, "best", 0,
#include "common/y4menc.h" #if CONFIG_LIBYUV #include "third_party/libyuv/include/libyuv/scale.h" #endif static const char *exec_name; struct AvxDecInputContext { struct AvxInputContext *aom_input_ctx; struct ObuDecInputContext *obu_ctx; struct WebmInputContext *webm_ctx; }; static const arg_def_t help = ARG_DEF(NULL, "help", 0, "Show usage options and exit"); static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1, "Number of times to decode the file"); static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1, "Codec to use"); static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0, "Output raw YV12 frames"); static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0, "Output raw I420 frames"); static const arg_def_t flipuvarg = ARG_DEF(NULL, "flipuv", 0, "Flip the chroma planes in the output"); static const arg_def_t rawvideo = ARG_DEF(NULL, "rawvideo", 0, "Output raw YUV frames"); static const arg_def_t noblitarg = ARG_DEF(NULL, "noblit", 0, "Don't process the decoded frames"); static const arg_def_t progressarg = ARG_DEF(NULL, "progress", 0, "Show progress after each frame decodes");