Commit Graph

577 Commits

Author SHA1 Message Date
Clément Bœsch
8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Clément Bœsch
04aefe205b Merge commit 'e0652795292223f8bc8e5bac019c1fca7323d23c'
* commit 'e0652795292223f8bc8e5bac019c1fca7323d23c':
  h264: remove an artificial restriction on the number of slice threads

Tested with multiple runs of fate-h264 THREADS=50 THREAD_TYPE=slice

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-21 10:24:31 +02:00
Matthieu Bouron
0ea58059d6 lavc/h264_ps: add ff_h264_ps_uninit and use it 2016-06-20 16:09:09 +02:00
Clément Bœsch
4053989890 Merge commit 'b77fffa127663028169c5ed543956af4b9496c29'
* commit 'b77fffa127663028169c5ed543956af4b9496c29':
  h264: make slice threading work with deblocking_filter=1

again label, and SLICE_SINGLETHREAD error handling are preserved as that
SLICE_SINGLETHREAD can be raised on a remaining case.

slice_context_count is also kept since it's still in use.

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 15:34:26 +02:00
Clément Bœsch
c8f7a23319 Merge commit '370ddc7b38d6b27b54fc2f5ee5f3dd9506f8c7c8'
* commit '370ddc7b38d6b27b54fc2f5ee5f3dd9506f8c7c8':
  h264: remove H264Context.pict_type

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 12:48:49 +02:00
Clément Bœsch
0ab1816315 Merge commit '56087ec0a29314d1860f6f0e6f40fbb9b40feccd'
* commit '56087ec0a29314d1860f6f0e6f40fbb9b40feccd':
  h264: drop a pointless indirection

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 12:31:29 +02:00
Clément Bœsch
cbe2dc7275 Merge commit '0e7772c5e4f1b31e2a3dda714ba4f89b1cca644a'
* commit '0e7772c5e4f1b31e2a3dda714ba4f89b1cca644a':
  h264: remove unused H264SliceContext.rbsp_buffer

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 12:07:10 +02:00
Clément Bœsch
c957909a9f Merge commit '7f045c4429e91688f1f2335dd347203431901c06'
* commit '7f045c4429e91688f1f2335dd347203431901c06':
  h264: merge ff_h264_free_context() into h264_decode_end()

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 12:03:21 +02:00
Clément Bœsch
d98ca4b14c Merge commit '99c554efc8b09c3f1bb2fb41c3da5431085f7470'
* commit '99c554efc8b09c3f1bb2fb41c3da5431085f7470':
  h264: eliminate low_delay

ff_print_debug_info2() is adjusted to allow a NULL pointer as low_delay.
It's only useful for MPEG codecs with the exception of H264.

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-20 11:47:40 +02:00
Clément Bœsch
d5cfe23324 Merge commit '89ae244e78a8d636fbb8427a2da052b04cf710bd'
* commit '89ae244e78a8d636fbb8427a2da052b04cf710bd':
  h264_refs: remove an unused parameter from ff_h264_fill_mbaff_ref_list()

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-19 13:45:59 +02:00
Clément Bœsch
0ed14bba12 Merge commit '72da8d9bb24d1b1bf74c2f1108650c0da0054d2e'
* commit '72da8d9bb24d1b1bf74c2f1108650c0da0054d2e':
  h264_parser: remove the remaining dependencies on the h264 decoder

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-19 12:50:24 +02:00
Clément Bœsch
34ec084b84 lavc/h264: move history parsing variable to H264ParseContext
This makes h264_find_frame_end() not depend on H264Context anymore.
2016-06-19 12:38:28 +02:00
Clément Bœsch
0bf5fd2e19 Merge commit '98c97994c5b90bdae02accb155eeceeb5224b8ef'
* commit '98c97994c5b90bdae02accb155eeceeb5224b8ef':
  h264: decouple extradata parsing from the decoder

Main changes:

- move get_avc_nalsize() inside h264_parser.c and make it use
  H264ParseContext instead of H264Context. This helps fixing
  fate-flv-demux.

- Also use is_avc/nal_length_size from the H264ParseContext in various
  places instead of the H264Context one as that's the fields now filled
  by ff_h264_decode_extradata()

- h264_parse: dont fail decode_extradata_ps() due to nal split failure.
  Change by Michael to fix decoding of h264/ref_10.avi.

Merged-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-19 12:17:41 +02:00
Clément Bœsch
5584f019b5 Merge commit '728d90a0c1973661a9e73da697bf4f90c9d19577'
* commit '728d90a0c1973661a9e73da697bf4f90c9d19577':
  h264: decouple h264_sei from the h264 decoder

Main changes:

- SEI decoding doesn't have access to the debug flag in the codec context so a
  few logging are dropped.

- naming of quincunx_sampling_flag and frame_packing_arrangement_type are kept
  as they are in FFmpeg instead of respectively quincunx_subsampling and
  arrangement_type used in Libav because the former match the specifications.

- don't reset the x264 build info once read in order to fix
  fate-h264-lossless (change by Hendrik)

- H264Context.has_recovery_point and deprecated
  AVCodecContext.dtg_active_format are set after ff_h264_sei_decode()
  based on the SEI state since ff_h264_sei_decode() doesn't have access
  to H264Context anymore.

- frame_packing_arrangement_type is not checked against <= 0 in
  decode_postinit() since it is always read as a positive value with
  get_bits(). This fixes a -Wtype-limits warning by GCC spotted by
  Michael.

Side Notes:

- tested that ffprobe on the file from ticket #3652 still returns 4
  keyframes
- tested that playback from ticket #3063 still works

Merged-by: Clément Bœsch <clement@stupeflix.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-18 14:04:55 +02:00
Clément Bœsch
7dd8cd1933 lavc/h264_sei: fix broken style around green metadata code 2016-06-14 08:23:23 +02:00
Clément Bœsch
5342bb624d lavc/h264: rename GreenMetaData to H264SEIGreenMetaData
Reduces diff for the next merge with Libav.
2016-06-14 08:23:23 +02:00
Clément Bœsch
bd3fd467fe Merge commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8'
* commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8':
  h264: factor out calculating the POC count into a separate file

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-12 19:01:43 +02:00
Clément Bœsch
83163577e2 lavc/h264: remove unused ff_h264_init_dequant_tables prototype
Unused since 1534ef87 / 3176217c.
2016-06-12 13:38:23 +02:00
Clément Bœsch
1534ef87c7 Merge commit '3176217c60ca7828712985092d9102d331ea4f3d'
* commit '3176217c60ca7828712985092d9102d331ea4f3d':
  h264: decouple h264_ps from the h264 decoder

Main changes:

- a local GetBitContext is created for the various
  ff_h264_decode_seq_parameter_set() attempts

- just like the old code, remove_sps() is adjusted so it doesn't remove
  the pps.

  Fixes decode with Ticket #631
  http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111108/dae58f17/attachment.mp4
  but see next point as well.

- ff_h264_update_thread_context() is updated to work even when SPS
  isn't set as it breaks current skip_frame code. This makes sure we
  can still decode the sample from ticket #631 without the need for
  -flags2 +chunks. (Thanks to Michael)

- keep {sps,pps}_ref pointers that stay alive even when the active
  pps/sps get removed from the available lists (patch by michaelni with
  additionnal frees in ff_h264_free_context() from mateo)

- added a check on sps in avpriv_h264_has_num_reorder_frames() to fix
  crashes with mpegts_with_dvbsubs.ts from Ticket #4074
  http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4074/mpegts_with_dvbsubs.ts

- in h264_parser.c:h264_parse(), after the ff_h264_decode_extradata() is
  called, the pps and sps from the local parser context are updated with
  the pps and sps from the used h264context. This fixes fate-flv-demux.

- in h264_slice.c, "PPS changed between slices" error is not triggered
  anymore in one condition as it makes fate-h264-xavc-4389 fails with
  THREADS=N (Thanks to Michael)

Merged-by: Clément Bœsch <clement@stupeflix.com>
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-12 13:26:52 +02:00
Derek Buitenhuis
278dcec28d Merge commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa'
* commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa':
  h264: factor out parsing the reference count into a separate file

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-17 15:16:38 +01:00
Hendrik Leppkes
15ad023210 Merge commit '8d0cc8ca97678f4ca87948ebabcbaab5a4f4c1f6'
* commit '8d0cc8ca97678f4ca87948ebabcbaab5a4f4c1f6':
  h264_parser: switch to h2645_parse for NAL unescaping

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-05-17 14:21:12 +02:00
Hendrik Leppkes
772ad7142d Merge commit 'ca2f19b9cc37be509d85f05c8f902860475905f8'
* commit 'ca2f19b9cc37be509d85f05c8f902860475905f8':
  h264: switch to h2645_parse for NAL parsing

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-05-07 21:13:44 +01:00
Vittorio Giovara
41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Derek Buitenhuis
a454ad670c Merge commit 'add1467e5e447b79e8743a0b05c54dcf58c61dfe'
* commit 'add1467e5e447b79e8743a0b05c54dcf58c61dfe':
  svq3: drop the build dependency on the h264 decoder

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-03 10:57:36 +01:00
Derek Buitenhuis
a2922b5d61 Merge commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad'
* commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad':
  h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-27 16:34:40 +01:00
Derek Buitenhuis
ee38234c43 Merge commit 'e481458bc308ee838deaeacac51929514762e7a7'
* commit 'e481458bc308ee838deaeacac51929514762e7a7':
  h264: factor out pred weight table parsing into a separate file

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 15:04:29 +01:00
Anton Khirnov
e065279529 h264: remove an artificial restriction on the number of slice threads
This limit is now unnecessary, we can easily support an arbitrary number
of threads.
2016-04-24 10:06:25 +02:00
Anton Khirnov
b77fffa127 h264: make slice threading work with deblocking_filter=1
In such a case, decode the MBs in parallel without the loop filter, then
execute the filter serially.

The ref2frm array was previously moved to H264SliceContext. That was
incorrect, since it applies to all the slices and should properly be in
H264Context (it did not actually break decoding, since this distinction
only becomes relevant with slice threading and deblocking_filter=1,
which was not implemented before this commit). The ref2frm array is thus
moved back to H264Context.
2016-04-24 10:06:25 +02:00
Anton Khirnov
370ddc7b38 h264: remove H264Context.pict_type
It is not used for anything internally, just exported in the output
frames. So remove the indirection and set it directly in frame_start().
2016-04-24 10:06:25 +02:00
Anton Khirnov
56087ec0a2 h264: drop a pointless indirection 2016-04-24 10:06:25 +02:00
Anton Khirnov
0e7772c5e4 h264: remove unused H264SliceContext.rbsp_buffer 2016-04-24 10:06:25 +02:00
Anton Khirnov
2e5bde9565 h264: eliminate max_contexts
It is always equal to nb_slice_ctx.
2016-04-24 10:06:25 +02:00
Anton Khirnov
7f045c4429 h264: merge ff_h264_free_context() into h264_decode_end()
It is no longer called from outside the h264 decoder.
2016-04-24 10:06:24 +02:00
Anton Khirnov
99c554efc8 h264: eliminate low_delay
It is always unconditionally initialized in decode_postinit() and then
immediately used in one place further below. All the other places where
it is accessed are just useless fluff.
2016-04-24 10:06:24 +02:00
Anton Khirnov
89ae244e78 h264_refs: remove an unused parameter from ff_h264_fill_mbaff_ref_list() 2016-04-24 10:06:24 +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
755f79f84c h264_refs: make the H264Context const where possible 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
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
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
Diego Biurrun
061dc20351 h264: Add missing ff_ prefix to internally visible h264_init_dequant_tables() 2016-03-30 17:19:13 +02:00
Anton Khirnov
ca2f19b9cc h264: switch to h2645_parse for NAL parsing 2016-03-28 10:16:28 +02:00
Anton Khirnov
add1467e5e svq3: drop the build dependency on the h264 decoder 2016-03-28 09:58:26 +02:00
Anton Khirnov
ecc31f6b08 h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse
It is shared with svq3.
2016-03-28 09:53:56 +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
Derek Buitenhuis
a38eadd7e9 Merge commit '5e555f93009f0605db120eec78262d0fe337e645'
AVClass is now a const, the rest are no-op.

* commit '5e555f93009f0605db120eec78262d0fe337e645':
  mpeg12enc: always write closed gops for intra only outputs
  h264: Add an AVClass pointer to H264Context
  libx264: Fix noise_reduction option assignment

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-04 16:17:05 +00:00
Michael Niedermayer
f435d081b0 h264: Add an AVClass pointer to H264Context
Sample-Id: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-02-22 19:08:56 -05:00