35 unsigned *_max,
unsigned *_sum)
38 unsigned max = 0, sum = 0;
40 for (n = 0; n < n_in; n++) {
41 unsigned sz = in[n]->
size;
54 unsigned max, sum, mag, marker, n, sz;
60 marker = 0xC0 + (mag << 3) + (n_in - 1);
61 sz = sum + 2 + (mag + 1) * n_in;
66 for (n = 0; n < n_in; n++) {
67 memcpy(ptr, in[n]->
data, in[n]->
size);
71#define wloop(mag, wr) \
73 for (n = 0; n < n_in; n++) { \
105 int res, invisible,
profile, marker, uses_superframe_syntax = 0, n;
120 marker =
pkt->data[
pkt->size - 1];
121 if ((marker & 0xe0) == 0xc0) {
122 int nbytes = 1 + ((marker >> 3) & 0x3);
123 int n_frames = 1 + (marker & 0x7), idx_sz = 2 + n_frames * nbytes;
125 uses_superframe_syntax =
pkt->size >= idx_sz &&
pkt->data[
pkt->size - idx_sz] == marker;
143 if (uses_superframe_syntax &&
s->n_cache > 0) {
145 "Mixing of superframe syntax and naked VP9 frames not supported\n");
148 }
else if ((!invisible || uses_superframe_syntax) && !
s->n_cache) {
153 "Too many invisible frames\n");
173 for (n = 0; n <
s->n_cache; n++)
204 for (n = 0; n <
s->n_cache; n++)
224 .p.name =
"vp9_superframe",
static enum AVCodecID codec_ids[]
static av_cold void close(AVCodecParserContext *s)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const FFBitStreamFilter ff_vp9_superframe_bsf
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
void(* flush)(AVBSFContext *ctx)
int(* init)(AVBSFContext *ctx)
static CheckasmStats stats
bitstream reader API header.
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodecID
Identify the syntax and semantics of the bitstream.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
The bitstream filter state.
This structure stores compressed data.
AVPacket * cache[MAX_CACHE]
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static AVFormatContext * ctx
static int merge_superframe(AVPacket *const *in, int n_in, AVPacket *out)
static void vp9_superframe_close(AVBSFContext *ctx)
static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
static void vp9_superframe_flush(AVBSFContext *ctx)
static int vp9_superframe_init(AVBSFContext *ctx)