[FFmpeg-devel] [PATCH] H264. Check if more RBSP data in PPS provided by current profile due to Annex A.

Michael Niedermayer michaelni at gmx.at
Fri Nov 25 15:44:18 CET 2011


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]


> +    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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111125/4183f70c/attachment.asc>


More information about the ffmpeg-devel mailing list