]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264_ps.c
Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'
[ffmpeg] / libavcodec / h264_ps.c
index 7d1cf192714ab0c9632dbbf5ccfe3c7fc3d83392..4a5f66e184f228988aed648b4d7a6135035dec7f 100644 (file)
 #include "internal.h"
 #include "mathops.h"
 #include "avcodec.h"
-#include "h264.h"
 #include "h264data.h"
+#include "h264_ps.h"
 #include "golomb.h"
 
 #define MAX_LOG2_MAX_FRAME_NUM    (12 + 4)
 #define MIN_LOG2_MAX_FRAME_NUM    4
 
+#define EXTENDED_SAR       255
+
 static const uint8_t default_scaling4[2][16] = {
     {  6, 13, 20, 28, 13, 20, 28, 32,
       20, 28, 32, 37, 28, 32, 37, 42 },
@@ -455,8 +457,7 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
     sps->ref_frame_count = get_ue_golomb_31(gb);
     if (avctx->codec_tag == MKTAG('S', 'M', 'V', '2'))
         sps->ref_frame_count = FFMAX(2, sps->ref_frame_count);
-    if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
-        sps->ref_frame_count > 16U) {
+    if (sps->ref_frame_count > MAX_DELAYED_PIC_COUNT) {
         av_log(avctx, AV_LOG_ERROR,
                "too many reference frames %d\n", sps->ref_frame_count);
         goto fail;