Go to the documentation of this file.
66 ctx->slot[
s]->slots &= ~(1 <<
s);
67 if (
ctx->slot[
s]->slots == 0)
79 unsigned int frame_marker;
80 unsigned int profile_low_bit, profile_high_bit, reserved_zero;
81 unsigned int error_resilient_mode;
89 if (frame_marker != 2) {
97 frame->profile = (profile_high_bit << 1) | profile_low_bit;
98 if (
frame->profile == 3) {
100 if (reserved_zero != 0) {
102 "unsupported profile or invalid bitstream.\n");
108 if (
frame->show_existing_frame) {
117 if (
frame->frame_type == 0) {
124 frame->refresh_frame_flags = 0xff;
128 if (
frame->show_frame == 0)
132 if (error_resilient_mode == 0) {
143 if (
frame->profile > 0) {
144 unsigned int color_space;
145 if (
frame->profile >= 2) {
150 if (color_space != 7 ) {
153 if (
frame->profile == 1 ||
frame->profile == 3) {
158 if (
frame->profile == 1 ||
frame->profile == 3)
177 *next_display = last_frame, *
frame;
187 if (
frame->needs_display && (!next_display ||
188 frame->pts < next_display->pts))
189 next_display =
frame;
199 frame = next_display;
201 if (
frame->needs_output &&
frame->needs_display &&
204 "%"PRId64
" (%"PRId64
") in order.\n",
209 frame->needs_output =
frame->needs_display = 0;
210 }
else if (
frame->needs_output) {
211 if (
frame->needs_display) {
213 "(%"PRId64
") for later display.\n",
217 "%"PRId64
" (%"PRId64
") to keep order.\n",
224 frame->needs_output = 0;
230 if (
frame->slots == 0) {
232 "which is no longer available?\n");
233 frame->needs_display = 0;
241 "(%"PRId64
") from slot %d.\n",
256 if (
frame->profile == 3) {
271 frame->needs_display = 0;
284 if (
ctx->next_frame) {
300 if ((in->
data[in->
size - 1] & 0xe0) == 0xc0) {
319 "frame: %d.\n", err);
323 frame->needs_output = 1;
326 if (
frame->show_existing_frame)
328 "(%"PRId64
"): show %u.\n",
frame->sequence,
332 "(%"PRId64
"): type %u show %u refresh %02x.\n",
334 frame->show_frame,
frame->refresh_frame_flags);
340 if (!(
frame->refresh_frame_flags & (1 <<
s)))
342 if (
ctx->slot[
s] &&
ctx->slot[
s]->needs_display &&
343 ctx->slot[
s]->slots == (1 <<
s)) {
351 "output overwriting slot %d: %d.\n",
364 if (!(
frame->refresh_frame_flags & (1 <<
s)))
370 if (!
frame->refresh_frame_flags) {
374 "for transient frame.\n");
378 if (!
frame->needs_display) {
408 .
p.
name =
"vp9_raw_reorder",
unsigned int refresh_frame_flags
static void vp9_raw_reorder_clear_slot(VP9RawReorderContext *ctx, int s)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int vp9_raw_reorder_frame_parse(AVBSFContext *bsf, VP9RawReorderFrame *frame)
#define AVERROR_EOF
End of file.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
unsigned int show_existing_frame
void(* filter)(uint8_t *src, int stride, int qscale)
int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt)
Called by the bitstream filters to get the next packet for filtering.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
The bitstream filter state.
static void skip_bits(GetBitContext *s, int n)
static void vp9_raw_reorder_frame_free(VP9RawReorderFrame **frame)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const av_cold void * next_output(const AVOutputFormat *prev, AVClassCategory c2)
static int vp9_raw_reorder_filter(AVBSFContext *bsf, AVPacket *out)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int FUNC() frame_sync_code(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static unsigned int get_bits1(GetBitContext *s)
void(* flush)(AVBSFContext *ctx)
static enum AVCodecID vp9_raw_reorder_codec_ids[]
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVCodecID
Identify the syntax and semantics of the bitstream.
AVBitStreamFilter p
The public AVBitStreamFilter.
#define AV_NOPTS_VALUE
Undefined timestamp value.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int put_bits_count(PutBitContext *s)
unsigned int frame_to_show
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * priv_data
Opaque filter-specific private data.
VP9RawReorderFrame * slot[FRAME_SLOTS]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
const FFBitStreamFilter ff_vp9_raw_reorder_bsf
static int vp9_raw_reorder_make_output(AVBSFContext *bsf, AVPacket *out, VP9RawReorderFrame *last_frame)
static av_cold void vp9_raw_reorder_flush_close(AVBSFContext *bsf)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
VP9RawReorderFrame * next_frame