Use av_frame_move_ref() instead of av_frame_ref().
This allows to remove the separate variable for whether
we have already returned the delayed last pic. It also
makes stream looping work when looping multiple times;
previously the delayed pic was only output the first time,
because last_frame_output was never reset.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The file has buggy timestamps (it uses B-frames, yet pts==dts)
and therefore the last frame is currently discarded by FFmpeg cli.
Using -fps_mode passthrough avoids this and provides coverage
of the SVQ3 draining logic.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Reduces indentation and avoids an extra variable for whether
a sequence header has been found.
It also fixes potential undefined behaviour:
NULL + 0 is undefined and happens when no extradata is available.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This is a 16bit field in the spec, so using a single
put_bits() to write it is more natural.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
These have been added in 29644cb504
in 2007 at a time when the MPEG-1/2 parser just set
the AVCodecContext's dimensions when encountering a sequence header,
so that the checks for the coded dimensions didn't trigger.
Yet this is no more and so we can simply remove these redundant checks.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Otherwise the MpegEncContext would be unnecessarily reinitialized
once (this does not affect the output for an intra-only variant
like VCR2) in mpeg_decode_postinit().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
It is its only user. Also make it static and call it
before ff_mpeg_draw_horiz_band().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
We used to create our own buffer, but still used the DR1 flag,
which is not how it's supposed to work.
Instead, use ff_get_encode_buffer, and either host-map the buffer
before copying each slice via GPU transfers, or just copy each
slice manually if that fails or is unavailable.
Use 16-byte alignment (align=4) instead of 4-byte (align=2) in the function and
const macros. This improves instruction fetch and NEON load performance on
modern AArch64 CPUs.
I have several .ts captures where video and audio codec changes even
though the PMT version does not change and the PIDs stay the same.
This happens during transition to/from slate (mpeg2 video and audio)
to network broadcast (hevc video and eac3 audio in private PES).
I've updated fate ts-demux expected results.