[FFmpeg-devel] [PATCH] H264. Check if more RBSP data in PPS provided by current profile due to Annex A.
Anatoly Nenashev
anatoly.nenashev at ovsoft.ru
Fri Nov 25 16:20:17 CET 2011
On 25.11.2011 18:44, Michael Niedermayer wrote:
> On Fri, Nov 25, 2011 at 05:49:44PM +0400, Anatoly Nenashev wrote:
>
>> Subj.
>>
>> This patch also fix issue https://ffmpeg.org/trac/ffmpeg/ticket/685.
>>
>>
>
>> h264_ps.c | 19 ++++++++++++++++++-
>> 1 file changed, 18 insertions(+), 1 deletion(-)
>> 705fb675467c14ef8f7ee9777a8cb3f324254bdb h264_profile_check.patch
>> diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
>> index 7a4cfb0..111a6a3 100644
>> --- a/libavcodec/h264_ps.c
>> +++ b/libavcodec/h264_ps.c
>> @@ -485,6 +485,23 @@ build_qp_table(PPS *pps, int t, int index, const int depth)
>> pps->chroma_qp_table[t][i] = ff_h264_chroma_qp[depth-8][av_clip(i + index, 0, max_qp)];
>> }
>>
>> +static int more_rbsp_data_in_pps(H264Context *h)
>> +{
>> + const SPS *sps =&h->sps;
>>
> this could be wrong if there are multiple sps, it should use
> h->sps_buffers[pps->sps_id]
>
>
>
Ok.
>> + const int profile_idc = sps->profile_idc;
>> + const int constraint_set_flags = sps->constraint_set_flags;
>> +
>> + if (profile_idc == 66 || profile_idc == 77 ||
>> + profile_idc == 88 || constraint_set_flags& 7)
>>
> maybe a more minimal check would be safer, that is incase some other
> encoder sets the profile wrong
>
>
>
There is a note in specification, section 7.4.2.1.1:
"NOTE 1 – When one or more than one of constraint_set0_flag,
constraint_set1_flag, or constraint_set2_flag are equal to 1, the
coded video sequence must obey the constraints of all of the indicated
subclauses of subclause A.2. When profile_idc is equal to
44, 100, 110, 122, or 244, the values of constraint_set0_flag,
constraint_set1_flag, and constraint_set2_flag must all be equal
to 0."
Thus we may just check that constraint_set_flags & 7 is not 0. See new
patch in attachment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264_profile_check_v2.patch
Type: text/x-patch
Size: 1430 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111125/2f21f68d/attachment.bin>
More information about the ffmpeg-devel
mailing list