Commit Graph

95 Commits

Author SHA1 Message Date
Diego Biurrun d4c2103bd3 golomb: Convert to the new bitstream reader 2017-01-31 17:46:19 +01:00
Anton Khirnov 5c2fb561d9 h264: add H264_ prefix to the NAL unit types
This will prevent conflicts e.g. in code that deals with both h264 and
hevc.
2016-06-21 11:17:28 +02:00
Anton Khirnov b24dafe105 lavc: drop unnecessary h264dec.h includes 2016-06-21 11:15:11 +02:00
Anton Khirnov f638b67e57 h264: move the parameter set definitions to a new header file
The PS parsing code is independent from the decoder, so it makes more
sense for it to have its own separate header.
2016-06-21 11:13:29 +02:00
Anton Khirnov 251cbb4400 h264: create a new header for common h264 definitions
Move the NAL unit types into it. This will allow to stop including the
whole decoder-specific h264dec.h in some code that is unrelated to the
decoder and only needs some enum values.
2016-06-21 11:12:41 +02:00
Anton Khirnov 9df889a5f1 h264: rename h264.[ch] to h264dec.[ch]
This is more consistent with the naming of other decoders.
2016-06-21 11:11:26 +02:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Anton Khirnov 72da8d9bb2 h264_parser: remove the remaining dependencies on the h264 decoder 2016-04-24 10:06:24 +02:00
Anton Khirnov 98c97994c5 h264: decouple extradata parsing from the decoder
This will allow decoupling the parser from the decoder.
2016-04-24 10:06:24 +02:00
Anton Khirnov 728d90a0c1 h264: decouple h264_sei from the h264 decoder
Make the SEI parsing independent of the H264Context, to allow
decoupling the parser from the decoder.
2016-04-24 10:06:24 +02:00
Anton Khirnov c8dcff0cdb h264: factor out calculating the POC count into a separate file
This will allow decoupling the parser from the decoder.
2016-04-24 10:06:24 +02:00
Anton Khirnov 113aeee6ae h264_parser: move the H264DSPContext to the parser context 2016-04-24 10:06:24 +02:00
Anton Khirnov 3176217c60 h264: decouple h264_ps from the h264 decoder
Make the SPS/PPS parsing independent of the H264Context, to allow
decoupling the parser from the decoder. The change is modelled after the
one done earlier for HEVC.

Move the dequant buffers to the PPS to avoid complex checks whether they
changed and an expensive copy for frame threads.
2016-04-24 10:06:23 +02:00
Anton Khirnov 44d16df413 h264_parser: eliminate H264SliceContext usage
It is no longer needed for anything.
2016-04-24 10:06:23 +02:00
Anton Khirnov a6e27f7add h264: factor out parsing the reference count into a separate file
This will allow decoupling the parser from the decoder.
2016-04-24 10:06:23 +02:00
Anton Khirnov e9f884416c h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()
It has nothing to do with the reference count and so does not belong in
this function.
2016-04-24 10:06:23 +02:00
Anton Khirnov 8d0cc8ca97 h264_parser: switch to h2645_parse for NAL unescaping
Remove now unused ff_h264_decode_nal().
2016-04-24 10:06:23 +02:00
Anton Khirnov e481458bc3 h264: factor out pred weight table parsing into a separate file
This will allow decoupling the parser from the decoder.
2016-03-28 09:48:31 +02:00
Diego Biurrun a7da517f6a h264data: Move all data tables from a header to a .c file 2016-03-25 15:56:14 +01:00
Diego Biurrun 02cd8bb9cb h264: Clean up #includes 2016-03-25 15:23:55 +01:00
Diego Biurrun 8161220eee h264_parser: Rename close() to h264_close()
At least on AIX it conflicts with the close() libc function from unistd.h.
2015-11-01 14:52:01 +01:00
Anton Khirnov 5bf3c0fa49 h264: drop the now unused per-slice H264Contexts 2015-03-21 11:27:16 +01:00
Anton Khirnov 3178f4d33f h264: move rbsp_buffer into the per-slice context 2015-03-21 11:27:15 +01:00
Anton Khirnov f42485dbce h264: use a separate GetBitContext for slice data 2015-03-21 11:27:14 +01:00
Anton Khirnov 95eb35f305 h264: move the ref lists variables into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 56febc993b h264: move the slice type variables into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 92c6c2a605 h264: split weighted pred-related vars into per-slice context 2015-03-21 11:27:09 +01:00
Anton Khirnov 31d2039cb4 h264_parser: export video format and dimensions 2015-02-19 15:07:52 +01:00
Anton Khirnov 58ae8d5957 h264_parser: restore a comment lost in 0268a54 2015-01-27 09:09:56 +01:00
Anton Khirnov 9404a47a2d h264: move parser-only variables to their own context 2015-01-27 09:08:31 +01:00
John Stebbins 1b66726906 h264_parser: don't stop on SPS_EXT in split
Add SPS_EXT, SEI, and subset SPS to codes that are skipped during split.
These codes can come before the PPS and results in incomplete extradata.
2014-11-11 11:49:55 +01:00
Gabriel Dume f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Ben Avison db7f1c7c5a h264: Move start code search functions into separate source files.
This permits re-use with parsers for codecs which use similar start codes.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Vittorio Giovara e0c16e4e32 mpegvideo: move mpegvideo formats-related defines to mpegutils.h 2014-03-16 23:04:41 +01:00
Vittorio Giovara dc971acf4a h264_parser: use enum values in h264_find_frame_end() 2014-02-15 18:29:49 +01:00
Vittorio Giovara 73e8fab31d h264: print values in case of error
Also make error style consistent and drop redundant information.
2014-02-14 05:05:35 +01:00
Yusuke Nakamura 103d073dd7 h264_parser: Use ff_h264_reset_sei()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-22 10:55:22 +02:00
Michael Niedermayer 19f5384000 h264_parser: Fix order of operations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-22 10:53:04 +02:00
Yusuke Nakamura 4baba6c813 h264_parser: Fix POC parsing for the case where MMCO_RESET is present.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-15 20:02:55 +02:00
Yusuke Nakamura b81dbd6cb7 h264_parser: Fix POC parsing for the case where MMCO_RESET is absent.
The prev_ values were not set after parsing POC.
Increase length of the buffer decoded to parse enough safely.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-15 20:02:47 +02:00
Ben Avison 218d6844b3 h264dsp: Factorize code into a new function, h264_find_start_code_candidate
This performs the start code search which was previously part of
h264_find_frame_end() - the most CPU intensive part of the function.

By itself, this results in a performance regression:
              Before          After
              Mean   StdDev   Mean   StdDev  Change
Overall time  2925.6 26.2     3068.5 31.7    -4.7%

but this can more than be made up for by platform-optimised
implementations of the function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-08 12:08:30 +03:00
Ben Avison 7a82022ee2 h264_parser: Initialize the h264dsp context in the parser as well
Each AVStream struct for an H.264 elementary stream actually has two
copies of the H264DSPContext struct (and in fact all the other members
of H264Context as well):

((H264Context *) ((AVStream *)st)->codec->priv_data)->h264dsp
((H264Context *) ((AVStream *)st)->parser->priv_data)->h264dsp

but only the first of these was actually being initialised. This
prevented the addition of platform-specific implementations of
parser-related functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-08 12:08:28 +03:00
Yusuke Nakamura a8b19271c3 avcodec: Add output_picture_number to AVCodecParserContext
Set output_picture_number in H.264 parser.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-08-02 20:59:45 +02:00
Luca Barbato f8a4d5e970 h264_parser: K&R formatting cosmetics 2013-06-07 16:54:55 +02:00
Yusuke Nakamura 3f1a7ceb2c h264_parser: Set field_order and picture_structure.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-05-24 08:45:05 +02:00
Diego Biurrun 6fee1b90ce avcodec: Add av_cold attributes to init functions missing them 2013-05-04 21:09:45 +02:00
Diego Biurrun 088f38a4f9 avcodec: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:02:02 +02:00
Martin Storsjö f1e9398621 lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-26 09:50:02 +02:00
Anton Khirnov 2c54155407 h264: deMpegEncContextize
Most of the changes are just trivial are just trivial replacements of
fields from MpegEncContext with equivalent fields in H264Context.
Everything in h264* other than h264.c are those trivial changes.

The nontrivial parts are:
1) extracting a simplified version of the frame management code from
   mpegvideo.c. We don't need last/next_picture anymore, since h264 uses
   its own more complex system already and those were set only to appease
   the mpegvideo parts.
2) some tables that need to be allocated/freed in appropriate places.
3) hwaccels -- mostly trivial replacements.
   for dxva, the draw_horiz_band() call is moved from
   ff_dxva2_common_end_frame() to per-codec end_frame() callbacks,
   because it's now different for h264 and MpegEncContext-based
   decoders.
4) svq3 -- it does not use h264 complex reference system, so I just
   added some very simplistic frame management instead and dropped the
   use of ff_h264_frame_start(). Because of this I also had to move some
   initialization code to svq3.

Additional fixes for chroma format and bit depth changes by
Janne Grunau <janne-libav@jannau.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-15 16:35:16 +01:00
Diego Biurrun 9c6cf7f2c9 avcodec: Drop silly and/or broken printf debug output 2012-10-01 10:24:28 +02:00