aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_parser.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | lavc/h264_parser: pass logctx to h264_find_frame_end()Clément Bœsch2016-06-191-5/+5
| | | | | | | | This helps removing the H264Context from the H264ParseContext.
* | Merge commit '98c97994c5b90bdae02accb155eeceeb5224b8ef'Clément Bœsch2016-06-191-29/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * h264: decouple extradata parsing from the decoderAnton Khirnov2016-04-241-1/+5
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit '728d90a0c1973661a9e73da697bf4f90c9d19577'Clément Bœsch2016-06-181-15/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * h264: decouple h264_sei from the h264 decoderAnton Khirnov2016-04-241-9/+13
| | | | | | | | | | Make the SEI parsing independent of the H264Context, to allow decoupling the parser from the decoder.
* | Merge commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8'Clément Bœsch2016-06-121-16/+18
|\| | | | | | | | | | | | | * commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8': h264: factor out calculating the POC count into a separate file Merged-by: Clément Bœsch <u@pkh.me>
| * h264: factor out calculating the POC count into a separate fileAnton Khirnov2016-04-241-16/+18
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit '113aeee6aed35cb786a9f6d69b0cb210f498b9da'Clément Bœsch2016-06-121-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '113aeee6aed35cb786a9f6d69b0cb210f498b9da': h264_parser: move the H264DSPContext to the parser context H264Context is kept locally as it is currently needed for logging (h->avctx as log context) and for is_avc and nal_length_size. These later fields will later be obtained when the extradata parsing is decoupled from the decoder. This code will be updated accordingly when that commit is merged. Merged-by: Clément Bœsch <u@pkh.me>
| * h264_parser: move the H264DSPContext to the parser contextAnton Khirnov2016-04-241-3/+3
| |
* | Merge commit '3176217c60ca7828712985092d9102d331ea4f3d'Clément Bœsch2016-06-121-31/+73
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * h264: decouple h264_ps from the h264 decoderAnton Khirnov2016-04-241-29/+44
| | | | | | | | | | | | | | | | | | 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.
* | Merge commit '44d16df413878588659dd8901bba016b5a869fd1'Hendrik Leppkes2016-05-271-34/+32
|\| | | | | | | | | | | | | * commit '44d16df413878588659dd8901bba016b5a869fd1': h264_parser: eliminate H264SliceContext usage Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264_parser: eliminate H264SliceContext usageAnton Khirnov2016-04-241-34/+32
| | | | | | | | It is no longer needed for anything.
* | Merge commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa'Derek Buitenhuis2016-05-171-4/+6
|\| | | | | | | | | | | | | * commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa': h264: factor out parsing the reference count into a separate file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: factor out parsing the reference count into a separate fileAnton Khirnov2016-04-241-4/+6
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit 'e9f884416c76558098fc1f63825b293956e8483c'Derek Buitenhuis2016-05-171-0/+3
|\| | | | | | | | | | | | | * commit 'e9f884416c76558098fc1f63825b293956e8483c': h264: move reading direct_spatial_mv_pred out of ff_set_ref_count() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()Anton Khirnov2016-04-241-0/+3
| | | | | | | | | | It has nothing to do with the reference count and so does not belong in this function.
* | Merge commit '8d0cc8ca97678f4ca87948ebabcbaab5a4f4c1f6'Hendrik Leppkes2016-05-171-12/+27
|\| | | | | | | | | | | | | * commit '8d0cc8ca97678f4ca87948ebabcbaab5a4f4c1f6': h264_parser: switch to h2645_parse for NAL unescaping Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * h264_parser: switch to h2645_parse for NAL unescapingAnton Khirnov2016-04-241-10/+27
| | | | | | | | Remove now unused ff_h264_decode_nal().
* | Merge commit 'e481458bc308ee838deaeacac51929514762e7a7'Derek Buitenhuis2016-04-261-1/+2
|\| | | | | | | | | | | | | * commit 'e481458bc308ee838deaeacac51929514762e7a7': h264: factor out pred weight table parsing into a separate file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: factor out pred weight table parsing into a separate fileAnton Khirnov2016-03-281-1/+2
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit 'a7da517f6a5c472f46f67dd33bb6b95ccc919923'Derek Buitenhuis2016-04-241-1/+1
|\| | | | | | | | | | | | | * commit 'a7da517f6a5c472f46f67dd33bb6b95ccc919923': h264data: Move all data tables from a header to a .c file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264data: Move all data tables from a header to a .c fileDiego Biurrun2016-03-251-1/+1
| |
* | Merge commit '02cd8bb9cb4381c50f42a9284098cc8a33d397db'Derek Buitenhuis2016-04-241-3/+13
|\| | | | | | | | | | | | | * commit '02cd8bb9cb4381c50f42a9284098cc8a33d397db': h264: Clean up #includes Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: Clean up #includesDiego Biurrun2016-03-251-5/+13
| |
| * h264_parser: Rename close() to h264_close()Diego Biurrun2015-11-011-2/+2
| | | | | | | | At least on AIX it conflicts with the close() libc function from unistd.h.
* | avcodec: Use get_ue_golomb_long() when neededMark Harris2015-12-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_ue_golomb() cannot decode values larger than 8190 (the maximum value that can be golomb encoded in 25 bits) and produces the error "Invalid UE golomb code" if a larger value is encountered. Use get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294) when valid h264/hevc values can exceed 8190. This updates decoding of the following values: (maximum) first_mb_in_slice 36863* for level 5.2 abs_diff_pic_num_minus1 131071 difference_of_pic_nums_minus1 131071 idr_pic_id 65535 recovery_frame_cnt 65535 frame_packing_arrangement_id 4294967294 frame_packing_arrangement_repetition_period 16384 display_orientation_repetition_period 16384 An alternative would be to modify get_ue_golomb() to handle encoded values of up to 49 bits as was done for get_se_golomb() in a92816c. In that case get_ue_golomb() could continue to be used for all of these except frame_packing_arrangement_id. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/h264: Do not fail with randomly truncated VUIsMichael Niedermayer2015-04-101-1/+1
| | | | | | | | | | | | | | Fixes Ticket4445 Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5bf3c0fa49afd5bbf43aa841ff78007d72c80736'Michael Niedermayer2015-03-211-1/+0
|\| | | | | | | | | | | | | | | | | | | * commit '5bf3c0fa49afd5bbf43aa841ff78007d72c80736': h264: drop the now unused per-slice H264Contexts Conflicts: libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: drop the now unused per-slice H264ContextsAnton Khirnov2015-03-211-1/+0
| |
* | Merge commit '3178f4d33ff62243f7cdddb081db516ea34396c9'Michael Niedermayer2015-03-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '3178f4d33ff62243f7cdddb081db516ea34396c9': h264: move rbsp_buffer into the per-slice context Conflicts: libavcodec/h264.c libavcodec/h264_parser.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move rbsp_buffer into the per-slice contextAnton Khirnov2015-03-211-1/+1
| |
* | Merge commit 'f42485dbce614b3f63182845da43db690b427b7c'Michael Niedermayer2015-03-211-19/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f42485dbce614b3f63182845da43db690b427b7c': h264: use a separate GetBitContext for slice data Conflicts: libavcodec/h264.c libavcodec/h264_cavlc.c libavcodec/h264_parser.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: use a separate GetBitContext for slice dataAnton Khirnov2015-03-211-19/+21
| |
* | Merge commit '95eb35f30513e335990ad0d5dca6ddc318477291'Michael Niedermayer2015-03-211-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '95eb35f30513e335990ad0d5dca6ddc318477291': h264: move the ref lists variables into the per-slice context Conflicts: libavcodec/h264.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_direct.c libavcodec/h264_mb.c libavcodec/h264_picture.c libavcodec/h264_refs.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move the ref lists variables into the per-slice contextAnton Khirnov2015-03-211-2/+2
| |
* | Merge commit '56febc993b928ccc039a32158ca60b234c311875'Michael Niedermayer2015-03-211-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '56febc993b928ccc039a32158ca60b234c311875': h264: move the slice type variables into the per-slice context Conflicts: libavcodec/h264.c libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move the slice type variables into the per-slice contextAnton Khirnov2015-03-211-5/+5
| |
* | Merge commit '92c6c2a605f9b077b8fbc25b7ed6625541232b87'Michael Niedermayer2015-03-211-1/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '92c6c2a605f9b077b8fbc25b7ed6625541232b87': h264: split weighted pred-related vars into per-slice context Conflicts: libavcodec/h264.c libavcodec/h264.h libavcodec/h264_mb.c libavcodec/svq3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: split weighted pred-related vars into per-slice contextAnton Khirnov2015-03-211-1/+8
| |
* | Merge commit '31d2039cb42668ebcf08248bc48bbad44aa05f49'Michael Niedermayer2015-02-191-0/+29
|\| | | | | | | | | | | | | | | | | | | | | * commit '31d2039cb42668ebcf08248bc48bbad44aa05f49': h264_parser: export video format and dimensions Conflicts: libavcodec/h264_parser.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264_parser: export video format and dimensionsAnton Khirnov2015-02-191-0/+29
| |
| * h264_parser: restore a comment lost in 0268a54Anton Khirnov2015-01-271-0/+1
| |
* | avcodec/h264: use avpriv_find_start_code() in h264_split()Zhaoxiu Zeng2015-02-151-16/+19
| | | | | | | | | | | | | | | | This also allows replacing several literal numbers by named constants And it should be faster, the function is not speed relevant though as it is generally only called a few times at the streams start. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/h264_parser: Rename close()Michael Niedermayer2015-01-281-2/+2
| | | | | | | | | | | | | | This avoids a potential conflict with the equally named function for closing files It also could reduce confusion in debugger backtraces Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '9404a47a2d1df418946a338938eb6cdb3afed474'Michael Niedermayer2015-01-271-15/+27
|\| | | | | | | | | | | | | | | | | | | * commit '9404a47a2d1df418946a338938eb6cdb3afed474': h264: move parser-only variables to their own context Conflicts: libavcodec/h264_parser.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264: move parser-only variables to their own contextAnton Khirnov2015-01-271-14/+26
| |
* | avcodec/h264_parser: Avoid adding SEI to the global headerMichael Niedermayer2014-11-121-1/+4
| | | | | | | | | | | | Only consider SEI when no PPS has been found yet Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1b667269062eb6aec0b8726393ea91b7f7f57fde'Michael Niedermayer2014-11-111-2/+4
|\| | | | | | | | | | | | | * commit '1b667269062eb6aec0b8726393ea91b7f7f57fde': h264_parser: don't stop on SPS_EXT in split Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h264_parser: don't stop on SPS_EXT in splitJohn Stebbins2014-11-111-2/+4
| | | | | | | | | | 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.