1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

19 Commits

Author SHA1 Message Date
Andreas Rheinhardt
6df9020f45 cbs_mpeg2: Improve performance of writing slices
Instead of using a combination of bitreader and -writer for copying data,
one can byte-align the (obsolete and removed) bitreader to improve performance.
One can even use memcpy in the normal case.
This improved the time needed for writing the slicedata from 33618 to
2370 decicycles when tested on a video originating from a DVD (4194394
runs).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-11-11 19:22:52 +00:00
Mark Thompson
300ef25314 cbs: Add support for array subscripts in trace output
This makes the trace output for arrays significantly nicer.
2018-05-02 01:20:45 +01:00
James Almer
65d36473c9 avcodec/cbs_mpeg2: create a reference to the existing buffer when decomposing slice units
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-30 20:30:01 -03:00
James Almer
05c0f620bf avcodec/cbs_mpeg2: use existing buffer reference when splitting fragments
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-26 20:05:00 -03:00
James Almer
0161d91db0 avcodec/cbs_mpeg2: use memcpy when assembling fragments
before:
419022 decicycles in assemble_fragment,    2047 runs,      1 skips

after:
104621 decicycles in assemble_fragment,    2045 runs,      3 skips

Benched with a 2 minutes long 720x480 DVD mpeg2 sample.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-25 16:45:43 -03:00
James Almer
df3a2ff767 avcodec/cbs: use a reference to the assembled CodedBitstreamFragment buffer when writing packets
This saves one malloc + memcpy per packet

The CodedBitstreamFragment buffer is padded to follow the requirements
of AVPacket.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-05 11:44:51 -03:00
Mark Thompson
0cc8e34a94 Merge commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2'
* commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2':
  cbs: Refcount all the things!

Some changes for bitstream API.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 22:22:54 +00:00
Mark Thompson
cacb47633c Merge commit '1d12a545ce828eaf4fb37295400008ea37635ab8'
* commit '1d12a545ce828eaf4fb37295400008ea37635ab8':
  cbs: Add an explicit type for coded bitstream unit types

Mostly already present from 6734eef6b8, two
minor message changes are merged.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 21:25:48 +00:00
Mark Thompson
ce5870a3a8 cbs: Refcount all the things!
This makes it easier for users of the CBS API to get alloc/free right -
all subelements use the buffer API so that it's clear how to free them.
It also allows eliding some redundant copies: the packet -> fragment copy
disappears after this change if the input packet is refcounted, and more
codec-specific cases are now possible (but not included in this patch).
2018-02-20 22:04:12 +00:00
Mark Thompson
1d12a545ce cbs: Add an explicit type for coded bitstream unit types
Also fix conversion specifiers used for the unit type.
2018-02-20 22:04:12 +00:00
Carl Eugen Hoyos
9b79c65ec0 lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT. 2017-12-17 18:05:42 +01:00
Mark Thompson
5a6707e49b cbs_mpeg2: Fix marker_bit type 2017-12-02 15:21:30 +00:00
Mark Thompson
7bf3f38046 cbs: Add padding to slice data allocations
These may be read by the bitstream reader, so they should include the
necessary padding for overreads.
2017-12-02 15:21:30 +00:00
Mark Thompson
79d666aa57 cbs_mpeg2: Fix format specifier 2017-10-24 23:07:58 +01:00
Mark Thompson
5b2c71bb94 cbs_mpeg2: Fix type for marker_bit reading 2017-10-24 23:07:58 +01:00
Mark Thompson
686e388bbb lavc: Add coded bitstream read/write support for MPEG-2
(cherry picked from commit 2bc9ba8d3c)
(cherry picked from commit a41b69b5eb)
2017-10-17 20:56:29 +01:00
Mark Thompson
e7f64191b2 cbs: Add buffer padding when splitting fragments
Remove any trailing zeroes from H.26[45] NAL units at the same time.
2017-09-12 22:11:47 +01:00
Mark Thompson
44cde38c8a cbs: Always check for bitstream end before reading 2017-09-12 22:11:41 +01:00
Mark Thompson
2bc9ba8d3c lavc: Add coded bitstream read/write support for MPEG-2
Also enable MPEG-2 support in the trace_headers filter.
2017-08-20 13:59:17 +01:00