Overview

Request 2164 (accepted)

- update internal ffmpeg to version 2.8.1

Submit package home:enzokiel:...hes:Multimedia / avidemux3 to package Multimedia / avidemux3

avidemux3.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Fri Oct 16 2015 - joerg.lorenzen@ki.tng.de
4
+
5
+- update internal ffmpeg to version 2.8.1
6
+
7
+-------------------------------------------------------------------
8
 Wed Sep 09 2015 - joerg.lorenzen@ki.tng.de
9
 
10
 - update internal ffmpeg to version 2.8
11
avidemux3.spec Changed
10
 
1
@@ -16,7 +16,7 @@
2
 #
3
 
4
 
5
-%define         ffmpeg_version 2.8
6
+%define         ffmpeg_version 2.8.1
7
 
8
 Name:           avidemux3
9
 Summary:        Graphical video editing and transcoding tool
10
ffmpeg-2.8.tar.bz2/Changelog -> ffmpeg-2.8.1.tar.bz2/Changelog Changed
52
 
1
@@ -1,6 +1,50 @@
2
 Entries are sorted chronologically from oldest to youngest within each release,
3
 releases are sorted from youngest to oldest.
4
 
5
+version 2.8.1:
6
+- swscale: fix ticket #4881
7
+- doc: fix spelling errors
8
+- hls: only seek if there is an offset
9
+- asfdec: add more checks for size left in asf packet buffer
10
+- asfdec: alloc enough space for storing name in asf_read_metadata_obj
11
+- avcodec/pngdec: Check blend_op.
12
+- h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
13
+- avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
14
+- avformat/avidec: Workaround broken initial frame
15
+- avformat/hls: fix some cases of HLS streams which require cookies
16
+- avcodec/pngdec: reset has_trns after every decode_frame_png()
17
+- lavf/img2dec: Fix memory leak
18
+- avcodec/mp3: fix skipping zeros
19
+- avformat/srtdec: make sure we probe a number
20
+- configure: check for ID3D11VideoContext
21
+- avformat/vobsub: compare correct packet stream IDs
22
+- avformat/srtdec: more lenient first line probing
23
+- avformat/srtdec: fix number check for the first character
24
+- avcodec/mips: build fix for MSA 64bit
25
+- avcodec/mips: build fix for MSA
26
+- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
27
+- libavformat/hlsenc: Use of uninitialized memory unlinking old files
28
+- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
29
+- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
30
+- avcodec/ffv1dec: Explicitly check read_quant_table() return value
31
+- dnxhddata: correct weight tables
32
+- dnxhddec: decode and use interlace mb flag
33
+- swscale: fix ticket #4877
34
+- avcodec/rangecoder: Check e
35
+- avcodec/ffv1: seperate slice_count from max_slice_count
36
+- swscale: fix ticket 4850
37
+- cmdutils: Filter dst/srcw/h
38
+- avutil/log: fix zero length gnu_printf format string warning
39
+- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
40
+- swscale/swscale: Fix "unused variable" warning
41
+- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
42
+- MAINTAINERS: add 2.8, drop 2.2
43
+- doc: mention libavcodec can decode Opus natively
44
+- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
45
+- avfilter/af_ladspa: process all channels for nb_handles > 1
46
+- configure: add libsoxr to swresample's pkgconfig
47
+- lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
48
+
49
 version 2.8:
50
 - colorkey video filter
51
 - BFSTM/BCSTM demuxer
52
ffmpeg-2.8.tar.bz2/MAINTAINERS -> ffmpeg-2.8.1.tar.bz2/MAINTAINERS Changed
14
 
1
@@ -564,11 +564,11 @@
2
 Releases
3
 ========
4
 
5
+2.8                                     Michael Niedermayer
6
 2.7                                     Michael Niedermayer
7
 2.6                                     Michael Niedermayer
8
 2.5                                     Michael Niedermayer
9
 2.4                                     Michael Niedermayer
10
-2.2                                     Michael Niedermayer
11
 
12
 If you want to maintain an older release, please contact us
13
 
14
ffmpeg-2.8.tar.bz2/RELEASE -> ffmpeg-2.8.1.tar.bz2/RELEASE Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8
3
+2.8.1
4
ffmpeg-2.8.tar.bz2/VERSION -> ffmpeg-2.8.1.tar.bz2/VERSION Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8
3
+2.8.1
4
ffmpeg-2.8.tar.bz2/cmdutils.c -> ffmpeg-2.8.1.tar.bz2/cmdutils.c Changed
14
 
1
@@ -563,6 +563,12 @@
2
         struct SwsContext *sws = sws_alloc_context();
3
         int ret = av_opt_set(sws, opt, arg, 0);
4
         sws_freeContext(sws);
5
+        if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
6
+            !strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
7
+            !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
8
+            av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
9
+            return AVERROR(EINVAL);
10
+        }
11
         if (ret < 0) {
12
             av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
13
             return ret;
14
ffmpeg-2.8.tar.bz2/configure -> ffmpeg-2.8.1.tar.bz2/configure Changed
33
 
1
@@ -2374,7 +2374,7 @@
2
 
3
 # hardware accelerators
4
 crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
5
-d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
6
+d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
7
 dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
8
 vaapi_deps="va_va_h"
9
 vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h"
10
@@ -5147,6 +5147,7 @@
11
 
12
 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
13
 check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
14
+check_type "windows.h d3d11.h" "ID3D11VideoContext"
15
 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
16
 
17
 check_type "va/va.h" "VAPictureParameterBufferHEVC"
18
@@ -5261,7 +5262,7 @@
19
 enabled libsmbclient      && { use_pkg_config smbclient libsmbclient.h smbc_init ||
20
                                require smbclient libsmbclient.h smbc_init -lsmbclient; }
21
 enabled libsnappy         && require snappy snappy-c.h snappy_compress -lsnappy
22
-enabled libsoxr           && require libsoxr soxr.h soxr_create -lsoxr
23
+enabled libsoxr           && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
24
 enabled libssh            && require_pkg_config libssh libssh/sftp.h sftp_init
25
 enabled libspeex          && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
26
 enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
27
@@ -6264,4 +6265,4 @@
28
 pkgconfig_generate libpostproc   "FFmpeg postprocessing library"        "$LIBPOSTPROC_VERSION"   ""
29
 pkgconfig_generate libavresample "Libav audio resampling library"       "$LIBAVRESAMPLE_VERSION" "$LIBM"
30
 pkgconfig_generate libswscale    "FFmpeg image rescaling library"       "$LIBSWSCALE_VERSION"    "$LIBM"
31
-pkgconfig_generate libswresample "FFmpeg audio resampling library"      "$LIBSWRESAMPLE_VERSION" "$LIBM"
32
+pkgconfig_generate libswresample "FFmpeg audio resampling library"      "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"
33
ffmpeg-2.8.tar.bz2/doc/Doxyfile -> ffmpeg-2.8.1.tar.bz2/doc/Doxyfile Changed
10
 
1
@@ -31,7 +31,7 @@
2
 # This could be handy for archiving the generated documentation or
3
 # if some version control system is used.
4
 
5
-PROJECT_NUMBER         = 2.8
6
+PROJECT_NUMBER         = 2.8.1
7
 
8
 # With the PROJECT_LOGO tag one can specify a logo or icon that is included
9
 # in the documentation. The maximum height of the logo should not exceed 55
10
ffmpeg-2.8.tar.bz2/doc/encoders.texi -> ffmpeg-2.8.1.tar.bz2/doc/encoders.texi Changed
10
 
1
@@ -1353,7 +1353,7 @@
2
 @table @option
3
 @item format
4
 Can be set to either @code{j2k} or @code{jp2} (the default) that
5
-allows to store non-rgb pix_fmts.
6
+makes it possible to store non-rgb pix_fmts.
7
 
8
 @end table
9
 
10
ffmpeg-2.8.tar.bz2/doc/filters.texi -> ffmpeg-2.8.1.tar.bz2/doc/filters.texi Changed
64
 
1
@@ -1032,7 +1032,7 @@
2
 For example full key look like this @code{lavfi.astats.1.DC_offset} or
3
 this @code{lavfi.astats.Overall.Peak_count}.
4
 
5
-For description what each key means read bellow.
6
+For description what each key means read below.
7
 
8
 @item reset
9
 Set number of frame after which stats are going to be recalculated.
10
@@ -2199,7 +2199,7 @@
11
 reduction starts. Default is 20. Range is between 0.01 and 2000.
12
 
13
 @item release
14
-Amount of milliseconds the signal has to fall bellow the threshold before
15
+Amount of milliseconds the signal has to fall below the threshold before
16
 reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
17
 
18
 @item makeup
19
@@ -4118,7 +4118,7 @@
20
 @item threshold1
21
 @item threshold2
22
 @item threshold3
23
-Allows to limit the maximum change for each plane, default is 65535.
24
+Limit the maximum change for each plane, default is 65535.
25
 If 0, plane will remain unchanged.
26
 @end table
27
 
28
@@ -4321,7 +4321,7 @@
29
 @item threshold1
30
 @item threshold2
31
 @item threshold3
32
-Allows to limit the maximum change for each plane, default is 65535.
33
+Limit the maximum change for each plane, default is 65535.
34
 If 0, plane will remain unchanged.
35
 
36
 @item coordinates
37
@@ -5206,7 +5206,7 @@
38
 @item threshold1
39
 @item threshold2
40
 @item threshold3
41
-Allows to limit the maximum change for each plane, default is 65535.
42
+Limit the maximum change for each plane, default is 65535.
43
 If 0, plane will remain unchanged.
44
 
45
 @item coordinates
46
@@ -6900,7 +6900,7 @@
47
 @item threshold1
48
 @item threshold2
49
 @item threshold3
50
-Allows to limit the maximum change for each plane, default is 65535.
51
+Limit the maximum change for each plane, default is 65535.
52
 If 0, plane will remain unchanged.
53
 @end table
54
 
55
@@ -9881,7 +9881,7 @@
56
 @end example
57
 
58
 @item
59
-Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
60
+Convert input video from above below (left eye above, right eye below) to side by side crosseye.
61
 @example
62
 stereo3d=abl:sbsr
63
 @end example
64
ffmpeg-2.8.tar.bz2/doc/general.texi -> ffmpeg-2.8.1.tar.bz2/doc/general.texi Changed
12
 
1
@@ -983,8 +983,8 @@
2
 @item Musepack SV8           @tab     @tab  X
3
 @item Nellymoser Asao        @tab  X  @tab  X
4
 @item On2 AVC (Audio for Video Codec) @tab     @tab  X
5
-@item Opus                   @tab  E  @tab  E
6
-    @tab supported through external library libopus
7
+@item Opus                   @tab  E  @tab  X
8
+    @tab encoding supported through external library libopus
9
 @item PCM A-law              @tab  X  @tab  X
10
 @item PCM mu-law             @tab  X  @tab  X
11
 @item PCM signed 8-bit planar  @tab  X  @tab  X
12
ffmpeg-2.8.tar.bz2/libavcodec/Makefile -> ffmpeg-2.8.1.tar.bz2/libavcodec/Makefile Changed
10
 
1
@@ -861,7 +861,7 @@
2
 OBJS-$(CONFIG_MLP_PARSER)              += mlp_parser.o mlp.o
3
 OBJS-$(CONFIG_MPEG4VIDEO_PARSER)       += mpeg4video_parser.o h263.o \
4
                                           mpeg4videodec.o mpeg4video.o \
5
-                                          ituh263dec.o h263dec.o
6
+                                          ituh263dec.o h263dec.o h263data.o
7
 OBJS-$(CONFIG_PNG_PARSER)              += png_parser.o
8
 OBJS-$(CONFIG_MPEGAUDIO_PARSER)        += mpegaudio_parser.o \
9
                                           mpegaudiodecheader.o mpegaudiodata.o
10
ffmpeg-2.8.tar.bz2/libavcodec/dnxhddata.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/dnxhddata.c Changed
158
 
1
@@ -48,7 +48,7 @@
2
     90, 90, 85, 79, 73, 73, 73, 73,
3
 };
4
 
5
-/* Used in CID 1237, 1253 */
6
+/* Used in CID 1237, 1253, 1259 */
7
 static const uint8_t dnxhd_1237_luma_weight[] = {
8
      0,  32,  33,  34, 34, 36, 37, 36,
9
     36,  37,  38,  38, 38, 39, 41, 44,
10
@@ -60,7 +60,7 @@
11
     97, 100, 104, 102, 98, 98, 99, 99,
12
 };
13
 
14
-/* Used in CID 1237, 1253 */
15
+/* Used in CID 1237, 1253, 1259 */
16
 static const uint8_t dnxhd_1237_chroma_weight[] = {
17
      0,  32,  36,  39, 39, 38, 39,  41,
18
     45,  51,  57,  58, 53, 48, 47,  51,
19
@@ -204,6 +204,7 @@
20
     61, 59, 59, 59, 61, 62, 62, 62,
21
 };
22
 
23
+/* Used in CID 1252, 1258 */
24
 static const uint8_t dnxhd_1252_luma_weight[] = {
25
       0,  32,  34, 35, 36, 36, 36, 37,
26
      36,  37,  39, 40, 41, 40, 40, 40,
27
@@ -214,6 +215,8 @@
28
      71,  82,  90, 90, 88, 87, 90, 95,
29
     100, 107, 103, 97, 95, 93, 99, 99,
30
 };
31
+
32
+/* Used in CID 1252, 1258 */
33
 static const uint8_t dnxhd_1252_chroma_weight[] = {
34
       0,  32,  35,  36,  37,  37,  38,  40,
35
      42,  46,  49,  50,  50,  49,  49,  53,
36
@@ -226,80 +229,36 @@
37
 };
38
 
39
 static const uint8_t dnxhd_1256_chroma_weight[] = {
40
-     0, 32, 32, 32, 32, 32, 32, 33,
41
-    32, 32, 32, 32, 32, 32, 32, 34,
42
-    32, 32, 32, 32, 32, 32, 33, 37,
43
-    32, 32, 32, 32, 32, 32, 36, 39,
44
-    32, 32, 32, 32, 32, 34, 39, 44,
45
-    32, 37, 32, 32, 35, 40, 43, 49,
46
-    32, 33, 36, 36, 40, 43, 50, 60,
47
-    34, 37, 39, 44, 51, 56, 61, 70,
48
-};
49
-
50
-static const uint8_t dnxhd_1258_luma_weight[] = {
51
-     0, 32, 36, 36,  40,  40, 55, 60,
52
-    34, 36, 37, 40,  41,  48, 57, 82,
53
-    35, 36, 41, 41,  46,  52, 73, 82,
54
-    37, 40, 42, 45,  50,  65, 80, 87,
55
-    39, 41, 44, 49,  62,  78, 88, 90,
56
-    41, 44, 49, 58,  73,  90, 95, 95,
57
-    43, 52, 55, 68,  90, 100, 97, 93,
58
-    52, 53, 71, 82, 107, 103, 99, 99,
59
-};
60
-
61
-static const uint8_t dnxhd_1258_chroma_weight[] = {
62
-     0, 32, 37,  38,  49,  53,  65,  66,
63
-    35, 37, 40,  49,  56,  64,  65,  82,
64
-    36, 42, 50,  56,  64,  67,  73,  85,
65
-    46, 50, 57,  63,  71,  72,  89,  87,
66
-    49, 58, 65,  72,  78,  88,  88,  90,
67
-    60, 64, 74,  81,  84,  90,  95, 134,
68
-    62, 74, 77,  80,  90, 114, 129, 125,
69
-    74, 74, 90, 100, 128, 125, 116, 116,
70
-};
71
-
72
-static const uint8_t dnxhd_1259_luma_weight[] = {
73
-     0, 32, 36, 37,  41,  44,  54, 60,
74
-    33, 34, 36, 39,  43,  51,  62, 78,
75
-    34, 36, 38, 41,  49,  59,  73, 79,
76
-    37, 38, 40, 47,  55,  66,  80, 95,
77
-    38, 41, 46, 54,  63,  79,  93, 96,
78
-    46, 47, 56, 64,  78,  90,  97, 98,
79
-    49, 58, 66, 78,  89,  97, 102, 98,
80
-    61, 65, 82, 87, 100, 104,  99, 99,
81
-};
82
-
83
-static const uint8_t dnxhd_1259_chroma_weight[] = {
84
-     0, 32, 38, 39,  47,  51,  77, 83,
85
-    36, 39, 41, 48,  55,  74,  85, 95,
86
-    39, 45, 53, 58,  72,  83, 105, 89,
87
-    51, 58, 66, 73,  82, 109,  92, 95,
88
-    57, 75, 78, 89, 105,  95,  93, 96,
89
-    81, 82, 99, 99,  94,  90,  97, 98,
90
-    83, 96, 97, 93,  89,  97, 102, 98,
91
-    90, 94, 92, 88, 100, 104,  99, 99,
92
+     0, 32, 32, 32, 32, 32, 32, 32,
93
+    32, 32, 32, 32, 32, 32, 32, 32,
94
+    32, 32, 32, 32, 32, 32, 37, 32,
95
+    32, 32, 32, 32, 33, 32, 32, 32,
96
+    32, 32, 33, 34, 37, 36, 32, 32,
97
+    32, 33, 34, 37, 36, 34, 35, 36,
98
+    39, 44, 40, 40, 39, 39, 44, 43,
99
+    43, 51, 56, 50, 49, 60, 61, 70,
100
 };
101
 
102
 static const uint8_t dnxhd_1260_luma_weight[] = {
103
-     0, 32, 37, 37, 40, 41, 52, 53,
104
-    33, 36, 36, 38, 40, 48, 49, 52,
105
-    34, 34, 37, 39, 44, 47, 49, 54,
106
-    33, 35, 38, 40, 45, 46, 54, 51,
107
-    34, 37, 37, 42, 44, 49, 52, 48,
108
-    34, 34, 38, 43, 44, 51, 50, 50,
109
-    33, 36, 41, 44, 51, 52, 50, 54,
110
-    36, 38, 44, 47, 53, 53, 54, 54,
111
+     0, 32, 33, 34, 36, 37, 37, 36,
112
+    34, 33, 34, 35, 37, 38, 40, 41,
113
+    40, 39, 38, 37, 34, 33, 34, 37,
114
+    40, 44, 48, 52, 53, 49, 47, 45,
115
+    42, 38, 36, 36, 38, 41, 43, 44,
116
+    46, 49, 52, 54, 54, 49, 44, 44,
117
+    44, 47, 51, 51, 52, 51, 48, 50,
118
+    52, 53, 53, 50, 50, 54, 54, 54,
119
 };
120
 
121
 static const uint8_t dnxhd_1260_chroma_weight[] = {
122
-     0, 32, 40, 38, 42, 40, 45, 45,
123
-    34, 42, 36, 43, 38, 46, 46, 49,
124
-    38, 35, 43, 39, 44, 47, 47, 49,
125
-    35, 42, 43, 42, 46, 47, 49, 52,
126
-    38, 43, 43, 44, 50, 49, 56, 50,
127
-    42, 43, 44, 50, 51, 57, 52, 53,
128
-    41, 45, 46, 53, 53, 56, 53, 54,
129
-    46, 46, 51, 49, 56, 53, 58, 58,
130
+     0, 32, 34, 38, 42, 40, 38, 36,
131
+    35, 35, 38, 42, 43, 43, 42, 40,
132
+    38, 39, 43, 43, 42, 41, 43, 43,
133
+    42, 44, 46, 45, 45, 46, 47, 46,
134
+    44, 44, 45, 46, 46, 46, 50, 50,
135
+    47, 47, 49, 49, 49, 49, 51, 53,
136
+    51, 49, 53, 57, 56, 52, 50, 52,
137
+    56, 56, 53, 53, 53, 54, 58, 58,
138
 };
139
 
140
 /* Used in CID 1235, 1241, 1250, 1256 */
141
@@ -1090,14 +1049,14 @@
142
       { 350, 390, 440, 730, 880 },
143
       { { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
144
     { 1258, 960, 720, 0, 212992, 212992, 4, 8, 5,
145
-      dnxhd_1258_luma_weight, dnxhd_1258_chroma_weight,
146
+      dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
147
       dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
148
       dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
149
       dnxhd_1252_ac_flags,
150
       dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
151
       { 42, 60, 75, 115 } },
152
     { 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3,
153
-      dnxhd_1259_luma_weight, dnxhd_1259_chroma_weight,
154
+      dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
155
       dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
156
       dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
157
       dnxhd_1237_ac_flags,
158
ffmpeg-2.8.tar.bz2/libavcodec/dnxhddec.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/dnxhddec.c Changed
46
 
1
@@ -349,7 +349,12 @@
2
     uint8_t *dest_y, *dest_u, *dest_v;
3
     int dct_y_offset, dct_x_offset;
4
     int qscale, i;
5
+    int interlaced_mb = 0;
6
 
7
+    if (ctx->cid_table->cid == 1260) {
8
+        interlaced_mb = get_bits1(&ctx->gb);
9
+        qscale = get_bits(&ctx->gb, 10);
10
+    } else
11
     qscale = get_bits(&ctx->gb, 11);
12
     skip_bits1(&ctx->gb);
13
 
14
@@ -386,8 +391,12 @@
15
         dest_u += frame->linesize[1];
16
         dest_v += frame->linesize[2];
17
     }
18
+    if (interlaced_mb) {
19
+        dct_linesize_luma   <<= 1;
20
+        dct_linesize_chroma <<= 1;
21
+    }
22
 
23
-    dct_y_offset = dct_linesize_luma << 3;
24
+    dct_y_offset = interlaced_mb ? frame->linesize[0] : (dct_linesize_luma << 3);
25
     dct_x_offset = 8 << shift1;
26
     if (!ctx->is_444) {
27
         ctx->idsp.idct_put(dest_y,                               dct_linesize_luma, ctx->blocks[0]);
28
@@ -396,7 +405,7 @@
29
         ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
30
 
31
         if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
32
-            dct_y_offset = dct_linesize_chroma << 3;
33
+            dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
34
             ctx->idsp.idct_put(dest_u,                dct_linesize_chroma, ctx->blocks[2]);
35
             ctx->idsp.idct_put(dest_v,                dct_linesize_chroma, ctx->blocks[3]);
36
             ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
37
@@ -409,7 +418,7 @@
38
         ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
39
 
40
         if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
41
-            dct_y_offset = dct_linesize_chroma << 3;
42
+            dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
43
             ctx->idsp.idct_put(dest_u,                               dct_linesize_chroma, ctx->blocks[2]);
44
             ctx->idsp.idct_put(dest_u + dct_x_offset,                dct_linesize_chroma, ctx->blocks[3]);
45
             ctx->idsp.idct_put(dest_u + dct_y_offset,                dct_linesize_chroma, ctx->blocks[8]);
46
ffmpeg-2.8.tar.bz2/libavcodec/ffv1.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/ffv1.c Changed
50
 
1
@@ -101,7 +101,7 @@
2
 av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
3
 {
4
     int i, ret;
5
-    for (i = 0; i < f->slice_count; i++) {
6
+    for (i = 0; i < f->max_slice_count; i++) {
7
         FFV1Context *fs = f->slice_context[i];
8
         if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
9
             return AVERROR(ENOMEM);
10
@@ -113,10 +113,10 @@
11
 {
12
     int i;
13
 
14
-    f->slice_count = f->num_h_slices * f->num_v_slices;
15
-    av_assert0(f->slice_count > 0);
16
+    f->max_slice_count = f->num_h_slices * f->num_v_slices;
17
+    av_assert0(f->max_slice_count > 0);
18
 
19
-    for (i = 0; i < f->slice_count; i++) {
20
+    for (i = 0; i < f->max_slice_count; i++) {
21
         int sx          = i % f->num_h_slices;
22
         int sy          = i / f->num_h_slices;
23
         int sxs         = f->avctx->width  *  sx      / f->num_h_slices;
24
@@ -210,7 +210,7 @@
25
         ff_thread_release_buffer(avctx, &s->last_picture);
26
     av_frame_free(&s->last_picture.f);
27
 
28
-    for (j = 0; j < s->slice_count; j++) {
29
+    for (j = 0; j < s->max_slice_count; j++) {
30
         FFV1Context *fs = s->slice_context[j];
31
         for (i = 0; i < s->plane_count; i++) {
32
             PlaneContext *p = &fs->plane[i];
33
@@ -224,14 +224,14 @@
34
     av_freep(&avctx->stats_out);
35
     for (j = 0; j < s->quant_table_count; j++) {
36
         av_freep(&s->initial_states[j]);
37
-        for (i = 0; i < s->slice_count; i++) {
38
+        for (i = 0; i < s->max_slice_count; i++) {
39
             FFV1Context *sf = s->slice_context[i];
40
             av_freep(&sf->rc_stat2[j]);
41
         }
42
         av_freep(&s->rc_stat2[j]);
43
     }
44
 
45
-    for (i = 0; i < s->slice_count; i++)
46
+    for (i = 0; i < s->max_slice_count; i++)
47
         av_freep(&s->slice_context[i]);
48
 
49
     return 0;
50
ffmpeg-2.8.tar.bz2/libavcodec/ffv1.h -> ffmpeg-2.8.1.tar.bz2/libavcodec/ffv1.h Changed
9
 
1
@@ -118,6 +118,7 @@
2
 
3
     struct FFV1Context *slice_context[MAX_SLICES];
4
     int slice_count;
5
+    int max_slice_count;
6
     int num_v_slices;
7
     int num_h_slices;
8
     int slice_width;
9
ffmpeg-2.8.tar.bz2/libavcodec/ffv1dec.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/ffv1dec.c Changed
71
 
1
@@ -47,8 +47,11 @@
2
     else {
3
         int i, e, a;
4
         e = 0;
5
-        while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
6
+        while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
7
             e++;
8
+            if (e > 31)
9
+                return AVERROR_INVALIDDATA;
10
+        }
11
 
12
         a = 1;
13
         for (i = e - 1; i >= 0; i--)
14
@@ -302,7 +305,7 @@
15
     for (i = 0; i < f->plane_count; i++) {
16
         PlaneContext * const p = &fs->plane[i];
17
         int idx = get_symbol(c, state, 0);
18
-        if (idx > (unsigned)f->quant_table_count) {
19
+        if (idx >= (unsigned)f->quant_table_count) {
20
             av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
21
             return -1;
22
         }
23
@@ -499,7 +502,10 @@
24
     int context_count = 1;
25
 
26
     for (i = 0; i < 5; i++) {
27
-        context_count *= read_quant_table(c, quant_table[i], context_count);
28
+        int ret = read_quant_table(c, quant_table[i], context_count);
29
+        if (ret < 0)
30
+            return ret;
31
+        context_count *= ret;
32
         if (context_count > 32768U) {
33
             return AVERROR_INVALIDDATA;
34
         }
35
@@ -775,6 +781,7 @@
36
             av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
37
             return AVERROR_INVALIDDATA;
38
         }
39
+        f->slice_count = f->max_slice_count;
40
     } else if (f->version < 3) {
41
         f->slice_count = get_symbol(c, state, 0);
42
     } else {
43
@@ -789,8 +796,8 @@
44
             p -= size + trailer;
45
         }
46
     }
47
-    if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
48
-        av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
49
+    if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
50
+        av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
51
         return AVERROR_INVALIDDATA;
52
     }
53
 
54
@@ -1016,6 +1023,7 @@
55
     f->picture.f      = NULL;
56
     f->last_picture.f = NULL;
57
     f->sample_buffer  = NULL;
58
+    f->max_slice_count = 0;
59
     f->slice_count = 0;
60
 
61
     for (i = 0; i < f->quant_table_count; i++) {
62
@@ -1091,7 +1099,7 @@
63
         av_assert0(!fdst->sample_buffer);
64
     }
65
 
66
-    av_assert1(fdst->slice_count == fsrc->slice_count);
67
+    av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
68
 
69
 
70
     ff_thread_release_buffer(dst, &fdst->picture);
71
ffmpeg-2.8.tar.bz2/libavcodec/ffv1enc.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/ffv1enc.c Changed
26
 
1
@@ -977,6 +977,7 @@
2
 
3
     if ((ret = ff_ffv1_init_slice_contexts(s)) < 0)
4
         return ret;
5
+    s->slice_count = s->max_slice_count;
6
     if ((ret = ff_ffv1_init_slices_state(s)) < 0)
7
         return ret;
8
 
9
@@ -986,7 +987,7 @@
10
         if (!avctx->stats_out)
11
             return AVERROR(ENOMEM);
12
         for (i = 0; i < s->quant_table_count; i++)
13
-            for (j = 0; j < s->slice_count; j++) {
14
+            for (j = 0; j < s->max_slice_count; j++) {
15
                 FFV1Context *sf = s->slice_context[j];
16
                 av_assert0(!sf->rc_stat2[i]);
17
                 sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
18
@@ -1210,6 +1211,7 @@
19
             for (i = 0; i < f->quant_table_count; i++)
20
                 memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
21
 
22
+            av_assert0(f->slice_count == f->max_slice_count);
23
             for (j = 0; j < f->slice_count; j++) {
24
                 FFV1Context *fs = f->slice_context[j];
25
                 for (i = 0; i < 256; i++) {
26
ffmpeg-2.8.tar.bz2/libavcodec/g726.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/g726.c Changed
10
 
1
@@ -32,7 +32,7 @@
2
 
3
 /**
4
  * G.726 11bit float.
5
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
6
+ * G.726 Standard uses rather odd 11bit floating point arithmetic for
7
  * numerous occasions. It's a mystery to me why they did it this way
8
  * instead of simply using 32bit integer arithmetic.
9
  */
10
ffmpeg-2.8.tar.bz2/libavcodec/h264_mp4toannexb_bsf.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/h264_mp4toannexb_bsf.c Changed
19
 
1
@@ -122,7 +122,7 @@
2
         if (!unit_nb && !sps_done++) {
3
             unit_nb = *extradata++; /* number of pps unit(s) */
4
             if (unit_nb) {
5
-                ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4);
6
+                ctx->pps_offset = total_size;
7
                 pps_seen = 1;
8
             }
9
         }
10
@@ -276,7 +276,7 @@
11
 {
12
     H264BSFContext *ctx = bsfc->priv_data;
13
     if (ctx->private_spspps)
14
-        av_free(ctx->spspps_buf);
15
+        av_freep(&ctx->spspps_buf);
16
 }
17
 
18
 AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
19
ffmpeg-2.8.tar.bz2/libavcodec/hevc.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/hevc.c Changed
34
 
1
@@ -809,6 +809,8 @@
2
     s->HEVClc->tu.cu_qp_offset_cb = 0;
3
     s->HEVClc->tu.cu_qp_offset_cr = 0;
4
 
5
+    s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == NAL_CRA_NUT && s->last_eos);
6
+
7
     return 0;
8
 }
9
 
10
@@ -3135,6 +3137,7 @@
11
     s->pocTid0    = s0->pocTid0;
12
     s->max_ra     = s0->max_ra;
13
     s->eos        = s0->eos;
14
+    s->no_rasl_output_flag = s0->no_rasl_output_flag;
15
 
16
     s->is_nalff        = s0->is_nalff;
17
     s->nal_length_size = s0->nal_length_size;
18
@@ -3239,6 +3242,7 @@
19
 
20
     s->enable_parallel_tiles = 0;
21
     s->picture_struct = 0;
22
+    s->eos = 1;
23
 
24
     if(avctx->active_thread_type & FF_THREAD_SLICE)
25
         s->threads_number = avctx->thread_count;
26
@@ -3280,6 +3284,7 @@
27
     HEVCContext *s = avctx->priv_data;
28
     ff_hevc_flush_dpb(s);
29
     s->max_ra = INT_MAX;
30
+    s->eos = 1;
31
 }
32
 
33
 #define OFFSET(x) offsetof(HEVCContext, x)
34
ffmpeg-2.8.tar.bz2/libavcodec/hevc.h -> ffmpeg-2.8.1.tar.bz2/libavcodec/hevc.h Changed
9
 
1
@@ -866,6 +866,7 @@
2
     int bs_height;
3
 
4
     int is_decoded;
5
+    int no_rasl_output_flag;
6
 
7
     HEVCPredContext hpc;
8
     HEVCDSPContext hevcdsp;
9
ffmpeg-2.8.tar.bz2/libavcodec/hevc_refs.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/hevc_refs.c Changed
10
 
1
@@ -174,7 +174,7 @@
2
         int min_poc   = INT_MAX;
3
         int i, min_idx, ret;
4
 
5
-        if (s->sh.no_output_of_prior_pics_flag == 1) {
6
+        if (s->sh.no_output_of_prior_pics_flag == 1 && s->no_rasl_output_flag == 1) {
7
             for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
8
                 HEVCFrame *frame = &s->DPB[i];
9
                 if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc &&
10
ffmpeg-2.8.tar.bz2/libavcodec/mips/hevcpred_msa.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/mips/hevcpred_msa.c Changed
734
 
1
@@ -1915,24 +1915,24 @@
2
     v16u8 vec0;
3
     HEVCLocalContext *lc = s->HEVClc;
4
     int i;
5
-    int hshift = s->sps->hshift[c_idx];
6
-    int vshift = s->sps->vshift[c_idx];
7
+    int hshift = s->ps.sps->hshift[c_idx];
8
+    int vshift = s->ps.sps->vshift[c_idx];
9
     int size_in_luma_h = 16 << hshift;
10
-    int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size;
11
+    int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size;
12
     int size_in_luma_v = 16 << vshift;
13
-    int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size;
14
+    int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size;
15
     int x = x0 >> hshift;
16
     int y = y0 >> vshift;
17
-    int x_tb = (x0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
18
-    int y_tb = (y0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
19
+    int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
20
+    int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
21
 
22
     int cur_tb_addr =
23
-        s->pps->min_tb_addr_zs[(y_tb) * (s->sps->tb_mask + 2) + (x_tb)];
24
+        s->ps.pps->min_tb_addr_zs[(y_tb) * (s->ps.sps->tb_mask + 2) + (x_tb)];
25
 
26
     ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t);
27
     uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride;
28
 
29
-    int min_pu_width = s->sps->min_pu_width;
30
+    int min_pu_width = s->ps.sps->min_pu_width;
31
 
32
     enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c :
33
         lc->tu.intra_pred_mode;
34
@@ -1948,41 +1948,41 @@
35
     uint8_t *filtered_top = filtered_top_array + 1;
36
     int cand_bottom_left = lc->na.cand_bottom_left
37
         && cur_tb_addr >
38
-        s->pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->sps->tb_mask) *
39
-                               (s->sps->tb_mask + 2) + (x_tb - 1)];
40
+        s->ps.pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->ps.sps->tb_mask) *
41
+                               (s->ps.sps->tb_mask + 2) + (x_tb - 1)];
42
     int cand_left = lc->na.cand_left;
43
     int cand_up_left = lc->na.cand_up_left;
44
     int cand_up = lc->na.cand_up;
45
     int cand_up_right = lc->na.cand_up_right
46
         && cur_tb_addr >
47
-        s->pps->min_tb_addr_zs[(y_tb - 1) * (s->sps->tb_mask + 2) +
48
-                               ((x_tb + size_in_tbs_h) & s->sps->tb_mask)];
49
+        s->ps.pps->min_tb_addr_zs[(y_tb - 1) * (s->ps.sps->tb_mask + 2) +
50
+                               ((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask)];
51
 
52
     int bottom_left_size =
53
         (((y0 + 2 * size_in_luma_v) >
54
-          (s->sps->height) ? (s->sps->height) : (y0 +
55
+          (s->ps.sps->height) ? (s->ps.sps->height) : (y0 +
56
                                                  2 * size_in_luma_v)) -
57
          (y0 + size_in_luma_v)) >> vshift;
58
     int top_right_size =
59
         (((x0 + 2 * size_in_luma_h) >
60
-          (s->sps->width) ? (s->sps->width) : (x0 + 2 * size_in_luma_h)) -
61
+          (s->ps.sps->width) ? (s->ps.sps->width) : (x0 + 2 * size_in_luma_h)) -
62
          (x0 + size_in_luma_h)) >> hshift;
63
 
64
-    if (s->pps->constrained_intra_pred_flag == 1) {
65
-        int size_in_luma_pu_v = ((size_in_luma_v) >> s->sps->log2_min_pu_size);
66
-        int size_in_luma_pu_h = ((size_in_luma_h) >> s->sps->log2_min_pu_size);
67
-        int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
68
-        int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
69
+    if (s->ps.pps->constrained_intra_pred_flag == 1) {
70
+        int size_in_luma_pu_v = ((size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
71
+        int size_in_luma_pu_h = ((size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
72
+        int on_pu_edge_x = !(x0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
73
+        int on_pu_edge_y = !(y0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
74
         if (!size_in_luma_pu_h)
75
             size_in_luma_pu_h++;
76
         if (cand_bottom_left == 1 && on_pu_edge_x) {
77
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
78
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
79
             int y_bottom_pu =
80
-                ((y0 + size_in_luma_v) >> s->sps->log2_min_pu_size);
81
+                ((y0 + size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
82
             int max =
83
                 ((size_in_luma_pu_v) >
84
-                 (s->sps->min_pu_height -
85
-                  y_bottom_pu) ? (s->sps->min_pu_height -
86
+                 (s->ps.sps->min_pu_height -
87
+                  y_bottom_pu) ? (s->ps.sps->min_pu_height -
88
                                   y_bottom_pu) : (size_in_luma_pu_v));
89
             cand_bottom_left = 0;
90
             for (i = 0; i < max; i += 2)
91
@@ -1993,12 +1993,12 @@
92
                      PF_INTRA);
93
         }
94
         if (cand_left == 1 && on_pu_edge_x) {
95
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
96
-            int y_left_pu = ((y0) >> s->sps->log2_min_pu_size);
97
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
98
+            int y_left_pu = ((y0) >> s->ps.sps->log2_min_pu_size);
99
             int max =
100
                 ((size_in_luma_pu_v) >
101
-                 (s->sps->min_pu_height -
102
-                  y_left_pu) ? (s->sps->min_pu_height -
103
+                 (s->ps.sps->min_pu_height -
104
+                  y_left_pu) ? (s->ps.sps->min_pu_height -
105
                                 y_left_pu) : (size_in_luma_pu_v));
106
             cand_left = 0;
107
             for (i = 0; i < max; i += 2)
108
@@ -2009,20 +2009,20 @@
109
                      PF_INTRA);
110
         }
111
         if (cand_up_left == 1) {
112
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
113
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
114
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
115
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
116
             cand_up_left =
117
                 (s->ref->tab_mvf[(x_left_pu) +
118
                                  (y_top_pu) * min_pu_width]).pred_flag ==
119
                 PF_INTRA;
120
         }
121
         if (cand_up == 1 && on_pu_edge_y) {
122
-            int x_top_pu = ((x0) >> s->sps->log2_min_pu_size);
123
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
124
+            int x_top_pu = ((x0) >> s->ps.sps->log2_min_pu_size);
125
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
126
             int max =
127
                 ((size_in_luma_pu_h) >
128
-                 (s->sps->min_pu_width -
129
-                  x_top_pu) ? (s->sps->min_pu_width -
130
+                 (s->ps.sps->min_pu_width -
131
+                  x_top_pu) ? (s->ps.sps->min_pu_width -
132
                                x_top_pu) : (size_in_luma_pu_h));
133
             cand_up = 0;
134
             for (i = 0; i < max; i += 2)
135
@@ -2032,13 +2032,13 @@
136
                                       min_pu_width]).pred_flag == PF_INTRA);
137
         }
138
         if (cand_up_right == 1 && on_pu_edge_y) {
139
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
140
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
141
             int x_right_pu =
142
-                ((x0 + size_in_luma_h) >> s->sps->log2_min_pu_size);
143
+                ((x0 + size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
144
             int max =
145
                 ((size_in_luma_pu_h) >
146
-                 (s->sps->min_pu_width -
147
-                  x_right_pu) ? (s->sps->min_pu_width -
148
+                 (s->ps.sps->min_pu_width -
149
+                  x_right_pu) ? (s->ps.sps->min_pu_width -
150
                                  x_right_pu) : (size_in_luma_pu_h));
151
             cand_up_right = 0;
152
             for (i = 0; i < max; i += 2)
153
@@ -2093,56 +2093,56 @@
154
         } while (0);
155
     }
156
 
157
-    if (s->pps->constrained_intra_pred_flag == 1) {
158
+    if (s->ps.pps->constrained_intra_pred_flag == 1) {
159
         if (cand_bottom_left || cand_left || cand_up_left || cand_up
160
             || cand_up_right) {
161
             int size_max_x =
162
                 x0 + ((2 * 16) << hshift) <
163
-                s->sps->width ? 2 * 16 : (s->sps->width - x0) >> hshift;
164
+                s->ps.sps->width ? 2 * 16 : (s->ps.sps->width - x0) >> hshift;
165
             int size_max_y =
166
                 y0 + ((2 * 16) << vshift) <
167
-                s->sps->height ? 2 * 16 : (s->sps->height - y0) >> vshift;
168
+                s->ps.sps->height ? 2 * 16 : (s->ps.sps->height - y0) >> vshift;
169
             int j = 16 + (cand_bottom_left ? bottom_left_size : 0) - 1;
170
             if (!cand_up_right) {
171
-                size_max_x = x0 + ((16) << hshift) < s->sps->width ?
172
-                    16 : (s->sps->width - x0) >> hshift;
173
+                size_max_x = x0 + ((16) << hshift) < s->ps.sps->width ?
174
+                    16 : (s->ps.sps->width - x0) >> hshift;
175
             }
176
             if (!cand_bottom_left) {
177
-                size_max_y = y0 + ((16) << vshift) < s->sps->height ?
178
-                    16 : (s->sps->height - y0) >> vshift;
179
+                size_max_y = y0 + ((16) << vshift) < s->ps.sps->height ?
180
+                    16 : (s->ps.sps->height - y0) >> vshift;
181
             }
182
             if (cand_bottom_left || cand_left || cand_up_left) {
183
                 while (j > -1
184
                        &&
185
                        !((s->ref->tab_mvf[(((x0 +
186
-                                             ((-1) << hshift)) >> s->sps->
187
+                                             ((-1) << hshift)) >> s->ps.sps->
188
                                             log2_min_pu_size)) + (((y0 +
189
                                                                     ((j) <<
190
                                                                      vshift))
191
-                                                                   >> s->sps->
192
+                                                                   >> s->ps.sps->
193
                                                                    log2_min_pu_size))
194
                                           * min_pu_width]).pred_flag ==
195
                          PF_INTRA))
196
                     j--;
197
                 if (!
198
                     ((s->ref->tab_mvf[(((x0 +
199
-                                         ((-1) << hshift)) >> s->sps->
200
+                                         ((-1) << hshift)) >> s->ps.sps->
201
                                         log2_min_pu_size)) + (((y0 + ((j)
202
                                                                       <<
203
                                                                       vshift))
204
-                                                               >> s->sps->
205
+                                                               >> s->ps.sps->
206
                                                                log2_min_pu_size))
207
                                       * min_pu_width]).pred_flag == PF_INTRA)) {
208
                     j = 0;
209
                     while (j < size_max_x
210
                            &&
211
                            !((s->ref->tab_mvf[(((x0 +
212
-                                                 ((j) << hshift)) >> s->sps->
213
+                                                 ((j) << hshift)) >> s->ps.sps->
214
                                                 log2_min_pu_size)) + (((y0 +
215
                                                                         ((-1) <<
216
                                                                          vshift))
217
                                                                        >> s->
218
-                                                                       sps->
219
+                                                                       ps.sps->
220
                                                                        log2_min_pu_size))
221
                                               * min_pu_width]).pred_flag ==
222
                              PF_INTRA))
223
@@ -2151,12 +2151,12 @@
224
                         if (!
225
                             ((s->ref->tab_mvf[(((x0 +
226
                                                  ((i -
227
-                                                   1) << hshift)) >> s->sps->
228
+                                                   1) << hshift)) >> s->ps.sps->
229
                                                 log2_min_pu_size)) + (((y0 +
230
                                                                         ((-1) <<
231
                                                                          vshift))
232
                                                                        >> s->
233
-                                                                       sps->
234
+                                                                       ps.sps->
235
                                                                        log2_min_pu_size))
236
                                               * min_pu_width]).pred_flag ==
237
                              PF_INTRA))
238
@@ -2168,11 +2168,11 @@
239
                 while (j < size_max_x
240
                        &&
241
                        !((s->ref->tab_mvf[(((x0 +
242
-                                             ((j) << hshift)) >> s->sps->
243
+                                             ((j) << hshift)) >> s->ps.sps->
244
                                             log2_min_pu_size)) + (((y0 + ((-1)
245
                                                                           <<
246
                                                                           vshift))
247
-                                                                   >> s->sps->
248
+                                                                   >> s->ps.sps->
249
                                                                    log2_min_pu_size))
250
                                           * min_pu_width]).pred_flag ==
251
                          PF_INTRA))
252
@@ -2184,11 +2184,11 @@
253
                                 ((s->ref->tab_mvf[(((x0 +
254
                                                      ((i -
255
                                                        1) << hshift)) >>
256
-                                                    s->sps->log2_min_pu_size))
257
+                                                    s->ps.sps->log2_min_pu_size))
258
                                                   + (((y0 + ((-1)
259
                                                              << vshift))
260
                                                       >>
261
-                                                      s->sps->log2_min_pu_size))
262
+                                                      s->ps.sps->log2_min_pu_size))
263
                                                   *
264
                                                   min_pu_width]).pred_flag ==
265
                                  PF_INTRA))
266
@@ -2199,11 +2199,11 @@
267
                                 ((s->ref->tab_mvf[(((x0 +
268
                                                      ((i -
269
                                                        1) << hshift)) >>
270
-                                                    s->sps->log2_min_pu_size))
271
+                                                    s->ps.sps->log2_min_pu_size))
272
                                                   + (((y0 + ((-1)
273
                                                              << vshift))
274
                                                       >>
275
-                                                      s->sps->log2_min_pu_size))
276
+                                                      s->ps.sps->log2_min_pu_size))
277
                                                   *
278
                                                   min_pu_width]).pred_flag ==
279
                                  PF_INTRA))
280
@@ -2218,11 +2218,11 @@
281
                 for (i = 0; i < (0) + (size_max_y); i += 4)
282
                     if (!
283
                         ((s->ref->tab_mvf[(((x0 +
284
-                                             ((-1) << hshift)) >> s->sps->
285
+                                             ((-1) << hshift)) >> s->ps.sps->
286
                                             log2_min_pu_size)) + (((y0 +
287
                                                                     ((i) <<
288
                                                                      vshift))
289
-                                                                   >> s->sps->
290
+                                                                   >> s->ps.sps->
291
                                                                    log2_min_pu_size))
292
                                           * min_pu_width]).pred_flag ==
293
                          PF_INTRA))
294
@@ -2247,12 +2247,12 @@
295
                      i > (size_max_y - 1) - (size_max_y); i -= 4)
296
                     if (!
297
                         ((s->ref->tab_mvf[(((x0 +
298
-                                             ((-1) << hshift)) >> s->sps->
299
+                                             ((-1) << hshift)) >> s->ps.sps->
300
                                             log2_min_pu_size)) + (((y0 +
301
                                                                     ((i -
302
                                                                       3) <<
303
                                                                      vshift))
304
-                                                                   >> s->sps->
305
+                                                                   >> s->ps.sps->
306
                                                                    log2_min_pu_size))
307
                                           * min_pu_width]).pred_flag ==
308
                          PF_INTRA))
309
@@ -2261,11 +2261,11 @@
310
                         a = ((left[i - 3]) * 0x01010101U);
311
                 if (!
312
                     ((s->ref->tab_mvf[(((x0 +
313
-                                         ((-1) << hshift)) >> s->sps->
314
+                                         ((-1) << hshift)) >> s->ps.sps->
315
                                         log2_min_pu_size)) + (((y0 + ((-1)
316
                                                                       <<
317
                                                                       vshift))
318
-                                                               >> s->sps->
319
+                                                               >> s->ps.sps->
320
                                                                log2_min_pu_size))
321
                                       * min_pu_width]).pred_flag == PF_INTRA))
322
                     left[-1] = left[0];
323
@@ -2281,12 +2281,12 @@
324
                      i > (size_max_y - 1) - (size_max_y); i -= 4)
325
                     if (!
326
                         ((s->ref->tab_mvf[(((x0 +
327
-                                             ((-1) << hshift)) >> s->sps->
328
+                                             ((-1) << hshift)) >> s->ps.sps->
329
                                             log2_min_pu_size)) + (((y0 +
330
                                                                     ((i -
331
                                                                       3) <<
332
                                                                      vshift))
333
-                                                                   >> s->sps->
334
+                                                                   >> s->ps.sps->
335
                                                                    log2_min_pu_size))
336
                                           * min_pu_width]).pred_flag ==
337
                          PF_INTRA))
338
@@ -2300,11 +2300,11 @@
339
                 for (i = 0; i < (0) + (size_max_x); i += 4)
340
                     if (!
341
                         ((s->ref->tab_mvf[(((x0 +
342
-                                             ((i) << hshift)) >> s->sps->
343
+                                             ((i) << hshift)) >> s->ps.sps->
344
                                             log2_min_pu_size)) + (((y0 + ((-1)
345
                                                                           <<
346
                                                                           vshift))
347
-                                                                   >> s->sps->
348
+                                                                   >> s->ps.sps->
349
                                                                    log2_min_pu_size))
350
                                           * min_pu_width]).pred_flag ==
351
                          PF_INTRA))
352
@@ -2376,8 +2376,8 @@
353
     top[-1] = left[-1];
354
 
355
 
356
-    if (!s->sps->intra_smoothing_disabled_flag
357
-        && (c_idx == 0 || s->sps->chroma_format_idc == 3)) {
358
+    if (!s->ps.sps->intra_smoothing_disabled_flag
359
+        && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) {
360
         if (mode != INTRA_DC && 16 != 4) {
361
             int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
362
             int min_dist_vert_hor =
363
@@ -2432,24 +2432,24 @@
364
     v8i16 mul_val1 = { 1, 2, 3, 4, 5, 6, 7, 8 };
365
     HEVCLocalContext *lc = s->HEVClc;
366
     int i;
367
-    int hshift = s->sps->hshift[c_idx];
368
-    int vshift = s->sps->vshift[c_idx];
369
+    int hshift = s->ps.sps->hshift[c_idx];
370
+    int vshift = s->ps.sps->vshift[c_idx];
371
     int size_in_luma_h = 32 << hshift;
372
-    int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size;
373
+    int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size;
374
     int size_in_luma_v = 32 << vshift;
375
-    int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size;
376
+    int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size;
377
     int x = x0 >> hshift;
378
     int y = y0 >> vshift;
379
-    int x_tb = (x0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
380
-    int y_tb = (y0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask;
381
+    int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
382
+    int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
383
 
384
     int cur_tb_addr =
385
-        s->pps->min_tb_addr_zs[(y_tb) * (s->sps->tb_mask + 2) + (x_tb)];
386
+        s->ps.pps->min_tb_addr_zs[(y_tb) * (s->ps.sps->tb_mask + 2) + (x_tb)];
387
 
388
     ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t);
389
     uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride;
390
 
391
-    int min_pu_width = s->sps->min_pu_width;
392
+    int min_pu_width = s->ps.sps->min_pu_width;
393
 
394
     enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c :
395
         lc->tu.intra_pred_mode;
396
@@ -2465,41 +2465,41 @@
397
     uint8_t *filtered_top = filtered_top_array + 1;
398
     int cand_bottom_left = lc->na.cand_bottom_left
399
         && cur_tb_addr >
400
-        s->pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->sps->tb_mask) *
401
-                               (s->sps->tb_mask + 2) + (x_tb - 1)];
402
+        s->ps.pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->ps.sps->tb_mask) *
403
+                               (s->ps.sps->tb_mask + 2) + (x_tb - 1)];
404
     int cand_left = lc->na.cand_left;
405
     int cand_up_left = lc->na.cand_up_left;
406
     int cand_up = lc->na.cand_up;
407
     int cand_up_right = lc->na.cand_up_right
408
         && cur_tb_addr >
409
-        s->pps->min_tb_addr_zs[(y_tb - 1) * (s->sps->tb_mask + 2) +
410
-                               ((x_tb + size_in_tbs_h) & s->sps->tb_mask)];
411
+        s->ps.pps->min_tb_addr_zs[(y_tb - 1) * (s->ps.sps->tb_mask + 2) +
412
+                               ((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask)];
413
 
414
     int bottom_left_size =
415
         (((y0 + 2 * size_in_luma_v) >
416
-          (s->sps->height) ? (s->sps->height) : (y0 +
417
+          (s->ps.sps->height) ? (s->ps.sps->height) : (y0 +
418
                                                  2 * size_in_luma_v)) -
419
          (y0 + size_in_luma_v)) >> vshift;
420
     int top_right_size =
421
         (((x0 + 2 * size_in_luma_h) >
422
-          (s->sps->width) ? (s->sps->width) : (x0 + 2 * size_in_luma_h)) -
423
+          (s->ps.sps->width) ? (s->ps.sps->width) : (x0 + 2 * size_in_luma_h)) -
424
          (x0 + size_in_luma_h)) >> hshift;
425
 
426
-    if (s->pps->constrained_intra_pred_flag == 1) {
427
-        int size_in_luma_pu_v = ((size_in_luma_v) >> s->sps->log2_min_pu_size);
428
-        int size_in_luma_pu_h = ((size_in_luma_h) >> s->sps->log2_min_pu_size);
429
-        int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
430
-        int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
431
+    if (s->ps.pps->constrained_intra_pred_flag == 1) {
432
+        int size_in_luma_pu_v = ((size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
433
+        int size_in_luma_pu_h = ((size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
434
+        int on_pu_edge_x = !(x0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
435
+        int on_pu_edge_y = !(y0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
436
         if (!size_in_luma_pu_h)
437
             size_in_luma_pu_h++;
438
         if (cand_bottom_left == 1 && on_pu_edge_x) {
439
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
440
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
441
             int y_bottom_pu =
442
-                ((y0 + size_in_luma_v) >> s->sps->log2_min_pu_size);
443
+                ((y0 + size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
444
             int max =
445
                 ((size_in_luma_pu_v) >
446
-                 (s->sps->min_pu_height -
447
-                  y_bottom_pu) ? (s->sps->min_pu_height -
448
+                 (s->ps.sps->min_pu_height -
449
+                  y_bottom_pu) ? (s->ps.sps->min_pu_height -
450
                                   y_bottom_pu) : (size_in_luma_pu_v));
451
             cand_bottom_left = 0;
452
             for (i = 0; i < max; i += 2)
453
@@ -2510,12 +2510,12 @@
454
                      PF_INTRA);
455
         }
456
         if (cand_left == 1 && on_pu_edge_x) {
457
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
458
-            int y_left_pu = ((y0) >> s->sps->log2_min_pu_size);
459
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
460
+            int y_left_pu = ((y0) >> s->ps.sps->log2_min_pu_size);
461
             int max =
462
                 ((size_in_luma_pu_v) >
463
-                 (s->sps->min_pu_height -
464
-                  y_left_pu) ? (s->sps->min_pu_height -
465
+                 (s->ps.sps->min_pu_height -
466
+                  y_left_pu) ? (s->ps.sps->min_pu_height -
467
                                 y_left_pu) : (size_in_luma_pu_v));
468
             cand_left = 0;
469
             for (i = 0; i < max; i += 2)
470
@@ -2526,20 +2526,20 @@
471
                      PF_INTRA);
472
         }
473
         if (cand_up_left == 1) {
474
-            int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size);
475
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
476
+            int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
477
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
478
             cand_up_left =
479
                 (s->ref->tab_mvf[(x_left_pu) +
480
                                  (y_top_pu) * min_pu_width]).pred_flag ==
481
                 PF_INTRA;
482
         }
483
         if (cand_up == 1 && on_pu_edge_y) {
484
-            int x_top_pu = ((x0) >> s->sps->log2_min_pu_size);
485
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
486
+            int x_top_pu = ((x0) >> s->ps.sps->log2_min_pu_size);
487
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
488
             int max =
489
                 ((size_in_luma_pu_h) >
490
-                 (s->sps->min_pu_width -
491
-                  x_top_pu) ? (s->sps->min_pu_width -
492
+                 (s->ps.sps->min_pu_width -
493
+                  x_top_pu) ? (s->ps.sps->min_pu_width -
494
                                x_top_pu) : (size_in_luma_pu_h));
495
             cand_up = 0;
496
             for (i = 0; i < max; i += 2)
497
@@ -2549,13 +2549,13 @@
498
                                       min_pu_width]).pred_flag == PF_INTRA);
499
         }
500
         if (cand_up_right == 1 && on_pu_edge_y) {
501
-            int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size);
502
+            int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
503
             int x_right_pu =
504
-                ((x0 + size_in_luma_h) >> s->sps->log2_min_pu_size);
505
+                ((x0 + size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
506
             int max =
507
                 ((size_in_luma_pu_h) >
508
-                 (s->sps->min_pu_width -
509
-                  x_right_pu) ? (s->sps->min_pu_width -
510
+                 (s->ps.sps->min_pu_width -
511
+                  x_right_pu) ? (s->ps.sps->min_pu_width -
512
                                  x_right_pu) : (size_in_luma_pu_h));
513
             cand_up_right = 0;
514
             for (i = 0; i < max; i += 2)
515
@@ -2608,56 +2608,56 @@
516
         } while (0);
517
     }
518
 
519
-    if (s->pps->constrained_intra_pred_flag == 1) {
520
+    if (s->ps.pps->constrained_intra_pred_flag == 1) {
521
         if (cand_bottom_left || cand_left || cand_up_left || cand_up
522
             || cand_up_right) {
523
             int size_max_x =
524
                 x0 + ((2 * 32) << hshift) <
525
-                s->sps->width ? 2 * 32 : (s->sps->width - x0) >> hshift;
526
+                s->ps.sps->width ? 2 * 32 : (s->ps.sps->width - x0) >> hshift;
527
             int size_max_y =
528
                 y0 + ((2 * 32) << vshift) <
529
-                s->sps->height ? 2 * 32 : (s->sps->height - y0) >> vshift;
530
+                s->ps.sps->height ? 2 * 32 : (s->ps.sps->height - y0) >> vshift;
531
             int j = 32 + (cand_bottom_left ? bottom_left_size : 0) - 1;
532
             if (!cand_up_right) {
533
-                size_max_x = x0 + ((32) << hshift) < s->sps->width ?
534
-                    32 : (s->sps->width - x0) >> hshift;
535
+                size_max_x = x0 + ((32) << hshift) < s->ps.sps->width ?
536
+                    32 : (s->ps.sps->width - x0) >> hshift;
537
             }
538
             if (!cand_bottom_left) {
539
-                size_max_y = y0 + ((32) << vshift) < s->sps->height ?
540
-                    32 : (s->sps->height - y0) >> vshift;
541
+                size_max_y = y0 + ((32) << vshift) < s->ps.sps->height ?
542
+                    32 : (s->ps.sps->height - y0) >> vshift;
543
             }
544
             if (cand_bottom_left || cand_left || cand_up_left) {
545
                 while (j > -1
546
                        &&
547
                        !((s->ref->tab_mvf[(((x0 +
548
-                                             ((-1) << hshift)) >> s->sps->
549
+                                             ((-1) << hshift)) >> s->ps.sps->
550
                                             log2_min_pu_size)) + (((y0 +
551
                                                                     ((j) <<
552
                                                                      vshift))
553
-                                                                   >> s->sps->
554
+                                                                   >> s->ps.sps->
555
                                                                    log2_min_pu_size))
556
                                           * min_pu_width]).pred_flag ==
557
                          PF_INTRA))
558
                     j--;
559
                 if (!
560
                     ((s->ref->tab_mvf[(((x0 +
561
-                                         ((-1) << hshift)) >> s->sps->
562
+                                         ((-1) << hshift)) >> s->ps.sps->
563
                                         log2_min_pu_size)) + (((y0 + ((j)
564
                                                                       <<
565
                                                                       vshift))
566
-                                                               >> s->sps->
567
+                                                               >> s->ps.sps->
568
                                                                log2_min_pu_size))
569
                                       * min_pu_width]).pred_flag == PF_INTRA)) {
570
                     j = 0;
571
                     while (j < size_max_x
572
                            &&
573
                            !((s->ref->tab_mvf[(((x0 +
574
-                                                 ((j) << hshift)) >> s->sps->
575
+                                                 ((j) << hshift)) >> s->ps.sps->
576
                                                 log2_min_pu_size)) + (((y0 +
577
                                                                         ((-1) <<
578
                                                                          vshift))
579
                                                                        >> s->
580
-                                                                       sps->
581
+                                                                       ps.sps->
582
                                                                        log2_min_pu_size))
583
                                               * min_pu_width]).pred_flag ==
584
                              PF_INTRA))
585
@@ -2666,12 +2666,12 @@
586
                         if (!
587
                             ((s->ref->tab_mvf[(((x0 +
588
                                                  ((i -
589
-                                                   1) << hshift)) >> s->sps->
590
+                                                   1) << hshift)) >> s->ps.sps->
591
                                                 log2_min_pu_size)) + (((y0 +
592
                                                                         ((-1) <<
593
                                                                          vshift))
594
                                                                        >> s->
595
-                                                                       sps->
596
+                                                                       ps.sps->
597
                                                                        log2_min_pu_size))
598
                                               * min_pu_width]).pred_flag ==
599
                              PF_INTRA))
600
@@ -2683,11 +2683,11 @@
601
                 while (j < size_max_x
602
                        &&
603
                        !((s->ref->tab_mvf[(((x0 +
604
-                                             ((j) << hshift)) >> s->sps->
605
+                                             ((j) << hshift)) >> s->ps.sps->
606
                                             log2_min_pu_size)) + (((y0 + ((-1)
607
                                                                           <<
608
                                                                           vshift))
609
-                                                                   >> s->sps->
610
+                                                                   >> s->ps.sps->
611
                                                                    log2_min_pu_size))
612
                                           * min_pu_width]).pred_flag ==
613
                          PF_INTRA))
614
@@ -2699,11 +2699,11 @@
615
                                 ((s->ref->tab_mvf[(((x0 +
616
                                                      ((i -
617
                                                        1) << hshift)) >>
618
-                                                    s->sps->log2_min_pu_size))
619
+                                                    s->ps.sps->log2_min_pu_size))
620
                                                   + (((y0 + ((-1)
621
                                                              << vshift))
622
                                                       >>
623
-                                                      s->sps->log2_min_pu_size))
624
+                                                      s->ps.sps->log2_min_pu_size))
625
                                                   *
626
                                                   min_pu_width]).pred_flag ==
627
                                  PF_INTRA))
628
@@ -2714,11 +2714,11 @@
629
                                 ((s->ref->tab_mvf[(((x0 +
630
                                                      ((i -
631
                                                        1) << hshift)) >>
632
-                                                    s->sps->log2_min_pu_size))
633
+                                                    s->ps.sps->log2_min_pu_size))
634
                                                   + (((y0 + ((-1)
635
                                                              << vshift))
636
                                                       >>
637
-                                                      s->sps->log2_min_pu_size))
638
+                                                      s->ps.sps->log2_min_pu_size))
639
                                                   *
640
                                                   min_pu_width]).pred_flag ==
641
                                  PF_INTRA))
642
@@ -2733,11 +2733,11 @@
643
                 for (i = 0; i < (0) + (size_max_y); i += 4)
644
                     if (!
645
                         ((s->ref->tab_mvf[(((x0 +
646
-                                             ((-1) << hshift)) >> s->sps->
647
+                                             ((-1) << hshift)) >> s->ps.sps->
648
                                             log2_min_pu_size)) + (((y0 +
649
                                                                     ((i) <<
650
                                                                      vshift))
651
-                                                                   >> s->sps->
652
+                                                                   >> s->ps.sps->
653
                                                                    log2_min_pu_size))
654
                                           * min_pu_width]).pred_flag ==
655
                          PF_INTRA))
656
@@ -2761,12 +2761,12 @@
657
                      i > (size_max_y - 1) - (size_max_y); i -= 4)
658
                     if (!
659
                         ((s->ref->tab_mvf[(((x0 +
660
-                                             ((-1) << hshift)) >> s->sps->
661
+                                             ((-1) << hshift)) >> s->ps.sps->
662
                                             log2_min_pu_size)) + (((y0 +
663
                                                                     ((i -
664
                                                                       3) <<
665
                                                                      vshift))
666
-                                                                   >> s->sps->
667
+                                                                   >> s->ps.sps->
668
                                                                    log2_min_pu_size))
669
                                           * min_pu_width]).pred_flag ==
670
                          PF_INTRA))
671
@@ -2775,11 +2775,11 @@
672
                         a = ((left[i - 3]) * 0x01010101U);
673
                 if (!
674
                     ((s->ref->tab_mvf[(((x0 +
675
-                                         ((-1) << hshift)) >> s->sps->
676
+                                         ((-1) << hshift)) >> s->ps.sps->
677
                                         log2_min_pu_size)) + (((y0 + ((-1)
678
                                                                       <<
679
                                                                       vshift))
680
-                                                               >> s->sps->
681
+                                                               >> s->ps.sps->
682
                                                                log2_min_pu_size))
683
                                       * min_pu_width]).pred_flag == PF_INTRA))
684
                     left[-1] = left[0];
685
@@ -2795,12 +2795,12 @@
686
                      i > (size_max_y - 1) - (size_max_y); i -= 4)
687
                     if (!
688
                         ((s->ref->tab_mvf[(((x0 +
689
-                                             ((-1) << hshift)) >> s->sps->
690
+                                             ((-1) << hshift)) >> s->ps.sps->
691
                                             log2_min_pu_size)) + (((y0 +
692
                                                                     ((i -
693
                                                                       3) <<
694
                                                                      vshift))
695
-                                                                   >> s->sps->
696
+                                                                   >> s->ps.sps->
697
                                                                    log2_min_pu_size))
698
                                           * min_pu_width]).pred_flag ==
699
                          PF_INTRA))
700
@@ -2814,11 +2814,11 @@
701
                 for (i = 0; i < (0) + (size_max_x); i += 4)
702
                     if (!
703
                         ((s->ref->tab_mvf[(((x0 +
704
-                                             ((i) << hshift)) >> s->sps->
705
+                                             ((i) << hshift)) >> s->ps.sps->
706
                                             log2_min_pu_size)) + (((y0 + ((-1)
707
                                                                           <<
708
                                                                           vshift))
709
-                                                                   >> s->sps->
710
+                                                                   >> s->ps.sps->
711
                                                                    log2_min_pu_size))
712
                                           * min_pu_width]).pred_flag ==
713
                          PF_INTRA))
714
@@ -2893,8 +2893,8 @@
715
     top[-1] = left[-1];
716
 
717
 
718
-    if (!s->sps->intra_smoothing_disabled_flag
719
-        && (c_idx == 0 || s->sps->chroma_format_idc == 3)) {
720
+    if (!s->ps.sps->intra_smoothing_disabled_flag
721
+        && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) {
722
         if (mode != INTRA_DC && 32 != 4) {
723
             int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
724
             int min_dist_vert_hor =
725
@@ -2908,7 +2908,7 @@
726
                      0 ? ((int) (mode - 26U)) : (-((int) (mode - 26U))))));
727
             if (min_dist_vert_hor > intra_hor_ver_dist_thresh[5 - 3]) {
728
                 int threshold = 1 << (8 - 5);
729
-                if (s->sps->sps_strong_intra_smoothing_enable_flag
730
+                if (s->ps.sps->sps_strong_intra_smoothing_enable_flag
731
                     && c_idx == 0
732
                     && ((top[-1] + top[63] - 2 * top[31]) >=
733
                         0 ? (top[-1] + top[63] -
734
ffmpeg-2.8.tar.bz2/libavcodec/mips/vp9_lpf_msa.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/mips/vp9_lpf_msa.c Changed
190
 
1
@@ -259,7 +259,7 @@
2
     mask_out = __msa_xori_b(mask_out, 0xff);                       \
3
 }
4
 
5
-void ff_loop_filter_v_4_8_msa(uint8_t *src, int32_t pitch,
6
+void ff_loop_filter_v_4_8_msa(uint8_t *src, ptrdiff_t pitch,
7
                               int32_t b_limit_ptr,
8
                               int32_t limit_ptr,
9
                               int32_t thresh_ptr)
10
@@ -288,7 +288,7 @@
11
 }
12
 
13
 
14
-void ff_loop_filter_v_44_16_msa(uint8_t *src, int32_t pitch,
15
+void ff_loop_filter_v_44_16_msa(uint8_t *src, ptrdiff_t pitch,
16
                                 int32_t b_limit_ptr,
17
                                 int32_t limit_ptr,
18
                                 int32_t thresh_ptr)
19
@@ -318,7 +318,7 @@
20
     ST_UB4(p1, p0, q0, q1, (src - 2 * pitch), pitch);
21
 }
22
 
23
-void ff_loop_filter_v_8_8_msa(uint8_t *src, int32_t pitch,
24
+void ff_loop_filter_v_8_8_msa(uint8_t *src, ptrdiff_t pitch,
25
                               int32_t b_limit_ptr,
26
                               int32_t limit_ptr,
27
                               int32_t thresh_ptr)
28
@@ -392,7 +392,7 @@
29
     }
30
 }
31
 
32
-void ff_loop_filter_v_88_16_msa(uint8_t *src, int32_t pitch,
33
+void ff_loop_filter_v_88_16_msa(uint8_t *src, ptrdiff_t pitch,
34
                                 int32_t b_limit_ptr,
35
                                 int32_t limit_ptr,
36
                                 int32_t thresh_ptr)
37
@@ -471,7 +471,7 @@
38
     }
39
 }
40
 
41
-void ff_loop_filter_v_84_16_msa(uint8_t *src, int32_t pitch,
42
+void ff_loop_filter_v_84_16_msa(uint8_t *src, ptrdiff_t pitch,
43
                                 int32_t b_limit_ptr,
44
                                 int32_t limit_ptr,
45
                                 int32_t thresh_ptr)
46
@@ -542,7 +542,7 @@
47
     }
48
 }
49
 
50
-void ff_loop_filter_v_48_16_msa(uint8_t *src, int32_t pitch,
51
+void ff_loop_filter_v_48_16_msa(uint8_t *src, ptrdiff_t pitch,
52
                                 int32_t b_limit_ptr,
53
                                 int32_t limit_ptr,
54
                                 int32_t thresh_ptr)
55
@@ -614,7 +614,7 @@
56
     }
57
 }
58
 
59
-static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, int32_t pitch,
60
+static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, ptrdiff_t pitch,
61
                                         uint8_t *filter48,
62
                                         int32_t b_limit_ptr,
63
                                         int32_t limit_ptr,
64
@@ -689,7 +689,7 @@
65
     }
66
 }
67
 
68
-static void vp9_hz_lpf_t16_16w(uint8_t *src, int32_t pitch, uint8_t *filter48)
69
+static void vp9_hz_lpf_t16_16w(uint8_t *src, ptrdiff_t pitch, uint8_t *filter48)
70
 {
71
     v16u8 flat, flat2, filter8;
72
     v16i8 zero = { 0 };
73
@@ -1021,7 +1021,7 @@
74
     }
75
 }
76
 
77
-void ff_loop_filter_v_16_16_msa(uint8_t *src, int32_t pitch,
78
+void ff_loop_filter_v_16_16_msa(uint8_t *src, ptrdiff_t pitch,
79
                                 int32_t b_limit_ptr,
80
                                 int32_t limit_ptr,
81
                                 int32_t thresh_ptr)
82
@@ -1037,7 +1037,7 @@
83
     }
84
 }
85
 
86
-void ff_loop_filter_v_16_8_msa(uint8_t *src, int32_t pitch,
87
+void ff_loop_filter_v_16_8_msa(uint8_t *src, ptrdiff_t pitch,
88
                                int32_t b_limit_ptr,
89
                                int32_t limit_ptr,
90
                                int32_t thresh_ptr)
91
@@ -1261,7 +1261,7 @@
92
     }
93
 }
94
 
95
-void ff_loop_filter_h_4_8_msa(uint8_t *src, int32_t pitch,
96
+void ff_loop_filter_h_4_8_msa(uint8_t *src, ptrdiff_t pitch,
97
                               int32_t b_limit_ptr,
98
                               int32_t limit_ptr,
99
                               int32_t thresh_ptr)
100
@@ -1290,7 +1290,7 @@
101
     ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
102
 }
103
 
104
-void ff_loop_filter_h_44_16_msa(uint8_t *src, int32_t pitch,
105
+void ff_loop_filter_h_44_16_msa(uint8_t *src, ptrdiff_t pitch,
106
                                 int32_t b_limit_ptr,
107
                                 int32_t limit_ptr,
108
                                 int32_t thresh_ptr)
109
@@ -1337,7 +1337,7 @@
110
     ST4x8_UB(tmp4, tmp5, src, pitch);
111
 }
112
 
113
-void ff_loop_filter_h_8_8_msa(uint8_t *src, int32_t pitch,
114
+void ff_loop_filter_h_8_8_msa(uint8_t *src, ptrdiff_t pitch,
115
                               int32_t b_limit_ptr,
116
                               int32_t limit_ptr,
117
                               int32_t thresh_ptr)
118
@@ -1417,7 +1417,7 @@
119
     }
120
 }
121
 
122
-void ff_loop_filter_h_88_16_msa(uint8_t *src, int32_t pitch,
123
+void ff_loop_filter_h_88_16_msa(uint8_t *src, ptrdiff_t pitch,
124
                                 int32_t b_limit_ptr,
125
                                 int32_t limit_ptr,
126
                                 int32_t thresh_ptr)
127
@@ -1531,7 +1531,7 @@
128
     }
129
 }
130
 
131
-void ff_loop_filter_h_84_16_msa(uint8_t *src, int32_t pitch,
132
+void ff_loop_filter_h_84_16_msa(uint8_t *src, ptrdiff_t pitch,
133
                                 int32_t b_limit_ptr,
134
                                 int32_t limit_ptr,
135
                                 int32_t thresh_ptr)
136
@@ -1635,7 +1635,7 @@
137
     }
138
 }
139
 
140
-void ff_loop_filter_h_48_16_msa(uint8_t *src, int32_t pitch,
141
+void ff_loop_filter_h_48_16_msa(uint8_t *src, ptrdiff_t pitch,
142
                                 int32_t b_limit_ptr,
143
                                 int32_t limit_ptr,
144
                                 int32_t thresh_ptr)
145
@@ -1912,7 +1912,7 @@
146
     }
147
 }
148
 
149
-static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, int32_t pitch,
150
+static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, ptrdiff_t pitch,
151
                                  uint8_t *filter48)
152
 {
153
     v16i8 zero = { 0 };
154
@@ -2136,7 +2136,7 @@
155
     }
156
 }
157
 
158
-void ff_loop_filter_h_16_8_msa(uint8_t *src, int32_t pitch,
159
+void ff_loop_filter_h_16_8_msa(uint8_t *src, ptrdiff_t pitch,
160
                                int32_t b_limit_ptr,
161
                                int32_t limit_ptr,
162
                                int32_t thresh_ptr)
163
@@ -2162,7 +2162,7 @@
164
 }
165
 
166
 static int32_t vp9_vt_lpf_t4_and_t8_16w(uint8_t *src, uint8_t *filter48,
167
-                                        uint8_t *src_org, int32_t pitch,
168
+                                        uint8_t *src_org, ptrdiff_t pitch,
169
                                         int32_t b_limit_ptr,
170
                                         int32_t limit_ptr,
171
                                         int32_t thresh_ptr)
172
@@ -2246,7 +2246,7 @@
173
     }
174
 }
175
 
176
-static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, int32_t pitch,
177
+static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, ptrdiff_t pitch,
178
                                   uint8_t *filter48)
179
 {
180
     v16u8 flat, flat2, filter8;
181
@@ -2573,7 +2573,7 @@
182
     }
183
 }
184
 
185
-void ff_loop_filter_h_16_16_msa(uint8_t *src, int32_t pitch,
186
+void ff_loop_filter_h_16_16_msa(uint8_t *src, ptrdiff_t pitch,
187
                                 int32_t b_limit_ptr,
188
                                 int32_t limit_ptr,
189
                                 int32_t thresh_ptr)
190
ffmpeg-2.8.tar.bz2/libavcodec/mjpegdec.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/mjpegdec.c Changed
17
 
1
@@ -995,7 +995,14 @@
2
                 skip_bits(&s->gb, 16); /* skip RSTn */
3
             }
4
         }
5
-        if (s->nb_components == 4) {
6
+        if (s->rct && s->nb_components == 4) {
7
+            for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
8
+                ptr[4*mb_x + 2] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200) >> 2);
9
+                ptr[4*mb_x + 1] = buffer[mb_x][1] + ptr[4*mb_x + 2];
10
+                ptr[4*mb_x + 3] = buffer[mb_x][2] + ptr[4*mb_x + 2];
11
+                ptr[4*mb_x + 0] = buffer[mb_x][3];
12
+            }
13
+        } else if (s->nb_components == 4) {
14
             for(i=0; i<nb_components; i++) {
15
                 int c= s->comp_index[i];
16
                 if (s->bits <= 8) {
17
ffmpeg-2.8.tar.bz2/libavcodec/mpegaudiodec_template.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/mpegaudiodec_template.c Changed
22
 
1
@@ -1657,9 +1657,11 @@
2
     uint32_t header;
3
     int ret;
4
 
5
+    int skipped = 0;
6
     while(buf_size && !*buf){
7
         buf++;
8
         buf_size--;
9
+        skipped++;
10
     }
11
 
12
     if (buf_size < HEADER_SIZE)
13
@@ -1714,7 +1716,7 @@
14
             return ret;
15
     }
16
     s->frame_size = 0;
17
-    return buf_size;
18
+    return buf_size + skipped;
19
 }
20
 
21
 static void mp_flush(MPADecodeContext *ctx)
22
ffmpeg-2.8.tar.bz2/libavcodec/pngdec.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/pngdec.c Changed
22
 
1
@@ -912,6 +912,11 @@
2
         cur_w > s->width - x_offset|| cur_h > s->height - y_offset)
3
             return AVERROR_INVALIDDATA;
4
 
5
+    if (blend_op != APNG_BLEND_OP_OVER && blend_op != APNG_BLEND_OP_SOURCE) {
6
+        av_log(avctx, AV_LOG_ERROR, "Invalid blend_op %d\n", blend_op);
7
+        return AVERROR_INVALIDDATA;
8
+    }
9
+
10
     if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
11
         // No previous frame to revert to for the first frame
12
         // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND
13
@@ -1254,7 +1259,7 @@
14
         return AVERROR_INVALIDDATA;
15
     }
16
 
17
-    s->y = s->state = 0;
18
+    s->y = s->state = s->has_trns = 0;
19
 
20
     /* init the zlib */
21
     s->zstream.zalloc = ff_png_zalloc;
22
ffmpeg-2.8.tar.bz2/libavcodec/snow.h -> ffmpeg-2.8.1.tar.bz2/libavcodec/snow.h Changed
10
 
1
@@ -565,6 +565,8 @@
2
         e= 0;
3
         while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
4
             e++;
5
+            if (e > 31)
6
+                return AVERROR_INVALIDDATA;
7
         }
8
 
9
         a= 1;
10
ffmpeg-2.8.tar.bz2/libavcodec/vaapi_hevc.c -> ffmpeg-2.8.1.tar.bz2/libavcodec/vaapi_hevc.c Changed
10
 
1
@@ -205,7 +205,7 @@
2
     pp->pps_tc_offset_div2 = h->ps.pps->tc_offset / 2;
3
     pp->log2_parallel_merge_level_minus2 = h->ps.pps->log2_parallel_merge_level - 2;
4
 
5
-    /* Diffrent chroma/luma bit depths are currently not supported by ffmpeg. */
6
+    /* Different chroma/luma bit depths are currently not supported by ffmpeg. */
7
     pp->bit_depth_luma_minus8 = h->ps.sps->bit_depth - 8;
8
     pp->bit_depth_chroma_minus8 = h->ps.sps->bit_depth - 8;
9
 
10
ffmpeg-2.8.tar.bz2/libavcodec/x86/sbrdsp.asm -> ffmpeg-2.8.1.tar.bz2/libavcodec/x86/sbrdsp.asm Changed
9
 
1
@@ -382,6 +382,7 @@
2
 %else
3
 %define count m_maxq
4
 %endif
5
+    movsxdifnidn    noiseq, noised
6
     dec    noiseq
7
     shl    count, 2
8
 %ifdef PIC
9
ffmpeg-2.8.tar.bz2/libavfilter/af_ladspa.c -> ffmpeg-2.8.1.tar.bz2/libavfilter/af_ladspa.c Changed
28
 
1
@@ -142,7 +142,7 @@
2
     AVFilterContext *ctx = inlink->dst;
3
     LADSPAContext *s = ctx->priv;
4
     AVFrame *out;
5
-    int i, h;
6
+    int i, h, p;
7
 
8
     if (!s->nb_outputs ||
9
         (av_frame_is_writable(in) && s->nb_inputs == s->nb_outputs &&
10
@@ -159,13 +159,15 @@
11
 
12
     for (h = 0; h < s->nb_handles; h++) {
13
         for (i = 0; i < s->nb_inputs; i++) {
14
+            p = s->nb_handles > 1 ? h : i;
15
             s->desc->connect_port(s->handles[h], s->ipmap[i],
16
-                                  (LADSPA_Data*)in->extended_data[i]);
17
+                                  (LADSPA_Data*)in->extended_data[p]);
18
         }
19
 
20
         for (i = 0; i < s->nb_outputs; i++) {
21
+            p = s->nb_handles > 1 ? h : i;
22
             s->desc->connect_port(s->handles[h], s->opmap[i],
23
-                                  (LADSPA_Data*)out->extended_data[i]);
24
+                                  (LADSPA_Data*)out->extended_data[p]);
25
         }
26
 
27
         s->desc->run(s->handles[h], in->nb_samples);
28
ffmpeg-2.8.tar.bz2/libavfilter/x86/vf_removegrain.asm -> ffmpeg-2.8.1.tar.bz2/libavfilter/x86/vf_removegrain.asm Changed
19
 
1
@@ -359,7 +359,7 @@
2
         paddw m2, m7 ; c2
3
         paddw m3, m6 ; c3
4
         paddw m4, m5 ; c4
5
-        ; As the differences (d1..d4) can only be postive, there is no need to
6
+        ; As the differences (d1..d4) can only be positive, there is no need to
7
         ; clip to zero.  Also, the maximum positive value is less than 768.
8
 
9
         pminsw m1, m2
10
@@ -485,7 +485,7 @@
11
         paddw m2, m7 ; c1
12
         paddw m3, m6 ; c1
13
         paddw m4, m5 ; c1
14
-        ; As the differences (d1..d4) can only be postive, there is no need to
15
+        ; As the differences (d1..d4) can only be positive, there is no need to
16
         ; clip to zero.  Also, the maximum positive value is less than 768.
17
 
18
         pminsw m1, m2
19
ffmpeg-2.8.tar.bz2/libavformat/asfdec_o.c -> ffmpeg-2.8.1.tar.bz2/libavformat/asfdec_o.c Changed
57
 
1
@@ -583,7 +583,7 @@
2
             break;
3
         type     = avio_rl16(pb);
4
         val_len  = avio_rl32(pb);
5
-        name     = av_malloc(name_len);
6
+        name     = av_malloc(buflen);
7
         if (!name)
8
             return AVERROR(ENOMEM);
9
         avio_get_str16le(pb, name_len, name,
10
@@ -1042,8 +1042,8 @@
11
     { "Mutex Language",               { 0xD6, 0xE2, 0x2A, 0x00, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
12
     { "Mutex Bitrate",                { 0xD6, 0xE2, 0x2A, 0x01, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
13
     { "Mutex Unknown",                { 0xD6, 0xE2, 0x2A, 0x02, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
14
-    { "Bandwith Sharing Exclusive",   { 0xAF, 0x60, 0x60, 0xAA, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
15
-    { "Bandwith Sharing Partial",     { 0xAF, 0x60, 0x60, 0xAB, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
16
+    { "Bandwidth Sharing Exclusive",  { 0xAF, 0x60, 0x60, 0xAA, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
17
+    { "Bandwidth Sharing Partial",    { 0xAF, 0x60, 0x60, 0xAB, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
18
     { "Payload Extension System Timecode", { 0x39, 0x95, 0x95, 0xEC, 0x86, 0x67, 0x4E, 0x2D, 0x8F, 0xDB, 0x98, 0x81, 0x4C, 0xE7, 0x6C, 0x1E }, asf_read_unknown, 1 },
19
     { "Payload Extension System File Name", { 0xE1, 0x65, 0xEC, 0x0E, 0x19, 0xED, 0x45, 0xD7, 0xB4, 0xA7, 0x25, 0xCB, 0xD1, 0xE2, 0x8E, 0x9B }, asf_read_unknown, 1 },
20
     { "Payload Extension System Content Type", { 0xD5, 0x90, 0xDC, 0x20, 0x07, 0xBC, 0x43, 0x6C, 0x9C, 0xF7, 0xF3, 0xBB, 0xFB, 0xF1, 0xA4, 0xDC }, asf_read_unknown, 1 },
21
@@ -1141,7 +1141,7 @@
22
     if (!asf_pkt->data_size) {
23
         asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size
24
         if (asf_pkt->data_size <= 0)
25
-            return AVERROR_EOF;
26
+            return AVERROR_INVALIDDATA;
27
         if ((ret = av_new_packet(&asf_pkt->avpkt, asf_pkt->data_size)) < 0)
28
             return ret;
29
     } else
30
@@ -1163,7 +1163,7 @@
31
     int ret;
32
     int skip = 0;
33
 
34
-    // if replicated lenght is 1, subpayloads are present
35
+    // if replicated length is 1, subpayloads are present
36
     if (asf->rep_data_len == 1) {
37
         asf->sub_left = 1;
38
         asf->state = READ_MULTI_SUB;
39
@@ -1190,6 +1190,8 @@
40
             skip = pay_len - asf_pkt->size_left;
41
             pay_len = asf_pkt->size_left;
42
         }
43
+        if (asf_pkt->size_left <= 0)
44
+            return AVERROR_INVALIDDATA;
45
         if ((ret = avio_read(pb, p, pay_len)) < 0)
46
             return ret;
47
         if (s->key && s->keylen == 20)
48
@@ -1237,7 +1239,7 @@
49
         return AVERROR_INVALIDDATA;
50
     }
51
     p = asf_pkt->avpkt.data + asf_pkt->data_size - asf_pkt->size_left;
52
-    if (size > asf_pkt->size_left)
53
+    if (size > asf_pkt->size_left || asf_pkt->size_left <= 0)
54
         return AVERROR_INVALIDDATA;
55
     if (asf_pkt->size_left > size)
56
         asf_pkt->size_left -= size;
57
ffmpeg-2.8.tar.bz2/libavformat/avidec.c -> ffmpeg-2.8.1.tar.bz2/libavformat/avidec.c Changed
11
 
1
@@ -1581,7 +1581,8 @@
2
         ast = st->priv_data;
3
 
4
         if (first_packet && first_packet_pos) {
5
-            data_offset  = first_packet_pos - pos;
6
+            if (avi->movi_list + 4 != pos || pos + 500 > first_packet_pos)
7
+                data_offset  = first_packet_pos - pos;
8
             first_packet = 0;
9
         }
10
         pos += data_offset;
11
ffmpeg-2.8.tar.bz2/libavformat/ffmdec.c -> ffmpeg-2.8.1.tar.bz2/libavformat/ffmdec.c Changed
10
 
1
@@ -151,7 +151,7 @@
2
     return size1 - size;
3
 }
4
 
5
-/* ensure that acutal seeking happens between FFM_PACKET_SIZE
6
+/* ensure that actual seeking happens between FFM_PACKET_SIZE
7
    and file_size - FFM_PACKET_SIZE */
8
 static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)
9
 {
10
ffmpeg-2.8.tar.bz2/libavformat/hls.c -> ffmpeg-2.8.1.tar.bz2/libavformat/hls.c Changed
27
 
1
@@ -516,15 +516,11 @@
2
     av_dict_copy(&tmp, opts, 0);
3
     av_dict_copy(&tmp, opts2, 0);
4
 
5
-    if ((ret = av_opt_set_dict(pls->input, &tmp)) < 0)
6
-        goto fail;
7
-
8
-    if ((ret = ffurl_connect(pls->input, NULL)) < 0) {
9
+    if ((ret = ffurl_connect(pls->input, &tmp)) < 0) {
10
         ffurl_close(pls->input);
11
         pls->input = NULL;
12
     }
13
 
14
-fail:
15
     av_dict_free(&tmp);
16
     return ret;
17
 }
18
@@ -1047,7 +1043,7 @@
19
     /* Seek to the requested position. If this was a HTTP request, the offset
20
      * should already be where want it to, but this allows e.g. local testing
21
      * without a HTTP server. */
22
-    if (ret == 0 && seg->key_type == KEY_NONE) {
23
+    if (ret == 0 && seg->key_type == KEY_NONE && seg->url_offset) {
24
         int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
25
         if (seekret < 0) {
26
             av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);
27
ffmpeg-2.8.tar.bz2/libavformat/hlsenc.c -> ffmpeg-2.8.1.tar.bz2/libavformat/hlsenc.c Changed
53
 
1
@@ -163,12 +163,6 @@
2
             ret = AVERROR(ENOMEM);
3
             goto fail;
4
         }
5
-        sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
6
-        sub_path = av_malloc(sub_path_size);
7
-        if (!sub_path) {
8
-            ret = AVERROR(ENOMEM);
9
-            goto fail;
10
-        }
11
 
12
         av_strlcpy(path, dirname, path_size);
13
         av_strlcat(path, segment->filename, path_size);
14
@@ -177,14 +171,23 @@
15
                                      path, strerror(errno));
16
         }
17
 
18
-        av_strlcpy(sub_path, dirname, sub_path_size);
19
-        av_strlcat(sub_path, segment->sub_filename, sub_path_size);
20
-        if (unlink(sub_path) < 0) {
21
-            av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
22
-                                     sub_path, strerror(errno));
23
+        if (segment->sub_filename[0] != '\0') {
24
+            sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
25
+            sub_path = av_malloc(sub_path_size);
26
+            if (!sub_path) {
27
+                ret = AVERROR(ENOMEM);
28
+                goto fail;
29
+            }
30
+
31
+            av_strlcpy(sub_path, dirname, sub_path_size);
32
+            av_strlcat(sub_path, segment->sub_filename, sub_path_size);
33
+            if (unlink(sub_path) < 0) {
34
+                av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
35
+                                         sub_path, strerror(errno));
36
+            }
37
+            av_free(sub_path);
38
         }
39
         av_freep(&path);
40
-        av_free(sub_path);
41
         previous_segment = segment;
42
         segment = previous_segment->next;
43
         av_free(previous_segment);
44
@@ -310,6 +313,8 @@
45
 
46
     if(hls->has_subtitle)
47
         av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), sizeof(en->sub_filename));
48
+    else
49
+        en->sub_filename[0] = '\0';
50
 
51
     en->duration = duration;
52
     en->pos      = pos;
53
ffmpeg-2.8.tar.bz2/libavformat/httpauth.c -> ffmpeg-2.8.1.tar.bz2/libavformat/httpauth.c Changed
32
 
1
@@ -220,21 +220,21 @@
2
 
3
     /* TODO: Escape the quoted strings properly. */
4
     av_strlcatf(authstr, len, "username=\"%s\"",   username);
5
-    av_strlcatf(authstr, len, ",realm=\"%s\"",     state->realm);
6
-    av_strlcatf(authstr, len, ",nonce=\"%s\"",     digest->nonce);
7
-    av_strlcatf(authstr, len, ",uri=\"%s\"",       uri);
8
-    av_strlcatf(authstr, len, ",response=\"%s\"",  response);
9
+    av_strlcatf(authstr, len, ", realm=\"%s\"",     state->realm);
10
+    av_strlcatf(authstr, len, ", nonce=\"%s\"",     digest->nonce);
11
+    av_strlcatf(authstr, len, ", uri=\"%s\"",       uri);
12
+    av_strlcatf(authstr, len, ", response=\"%s\"",  response);
13
 
14
     // we are violating the RFC and use "" because all others seem to do that too.
15
     if (digest->algorithm[0])
16
-        av_strlcatf(authstr, len, ",algorithm=\"%s\"",  digest->algorithm);
17
+        av_strlcatf(authstr, len, ", algorithm=\"%s\"",  digest->algorithm);
18
 
19
     if (digest->opaque[0])
20
-        av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque);
21
+        av_strlcatf(authstr, len, ", opaque=\"%s\"", digest->opaque);
22
     if (digest->qop[0]) {
23
-        av_strlcatf(authstr, len, ",qop=\"%s\"",    digest->qop);
24
-        av_strlcatf(authstr, len, ",cnonce=\"%s\"", cnonce);
25
-        av_strlcatf(authstr, len, ",nc=%s",         nc);
26
+        av_strlcatf(authstr, len, ", qop=\"%s\"",    digest->qop);
27
+        av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce);
28
+        av_strlcatf(authstr, len, ", nc=%s",         nc);
29
     }
30
 
31
     av_strlcatf(authstr, len, "\r\n");
32
ffmpeg-2.8.tar.bz2/libavformat/img2dec.c -> ffmpeg-2.8.1.tar.bz2/libavformat/img2dec.c Changed
58
 
1
@@ -444,14 +444,17 @@
2
     }
3
 
4
     res = av_new_packet(pkt, size[0] + size[1] + size[2]);
5
-    if (res < 0)
6
-        return res;
7
+    if (res < 0) {
8
+        goto fail;
9
+    }
10
     pkt->stream_index = 0;
11
     pkt->flags       |= AV_PKT_FLAG_KEY;
12
     if (s->ts_from_file) {
13
         struct stat img_stat;
14
-        if (stat(filename, &img_stat))
15
-            return AVERROR(EIO);
16
+        if (stat(filename, &img_stat)) {
17
+            res = AVERROR(EIO);
18
+            goto fail;
19
+        }
20
         pkt->pts = (int64_t)img_stat.st_mtime;
21
 #if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
22
         if (s->ts_from_file == 2)
23
@@ -485,18 +488,29 @@
24
     if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
25
         av_free_packet(pkt);
26
         if (ret[0] < 0) {
27
-            return ret[0];
28
+            res = ret[0];
29
         } else if (ret[1] < 0) {
30
-            return ret[1];
31
-        } else if (ret[2] < 0)
32
-            return ret[2];
33
-        return AVERROR_EOF;
34
+            res = ret[1];
35
+        } else if (ret[2] < 0) {
36
+            res = ret[2];
37
+        } else {
38
+            res = AVERROR_EOF;
39
+        }
40
+        goto fail;
41
     } else {
42
         s->img_count++;
43
         s->img_number++;
44
         s->pts++;
45
         return 0;
46
     }
47
+
48
+fail:
49
+    if (!s->is_pipe) {
50
+        for (i = 0; i < 3; i++) {
51
+            avio_closep(&f[i]);
52
+        }
53
+    }
54
+    return res;
55
 }
56
 
57
 static int img_read_close(struct AVFormatContext* s1)
58
ffmpeg-2.8.tar.bz2/libavformat/mov.c -> ffmpeg-2.8.1.tar.bz2/libavformat/mov.c Changed
13
 
1
@@ -838,9 +838,9 @@
2
     }
3
 
4
     /* drm blob processing */
5
-    avio_read(pb, output, 8); // go to offset 8, absolute postion 0x251
6
+    avio_read(pb, output, 8); // go to offset 8, absolute position 0x251
7
     avio_read(pb, input, DRM_BLOB_SIZE);
8
-    avio_read(pb, output, 4); // go to offset 4, absolute postion 0x28d
9
+    avio_read(pb, output, 4); // go to offset 4, absolute position 0x28d
10
     avio_read(pb, file_checksum, 20);
11
 
12
     av_log(c->fc, AV_LOG_INFO, "[aax] file checksum == "); // required by external tools
13
ffmpeg-2.8.tar.bz2/libavformat/mpeg.c -> ffmpeg-2.8.1.tar.bz2/libavformat/mpeg.c Changed
10
 
1
@@ -939,7 +939,7 @@
2
         total_read += pkt_size;
3
 
4
         /* the current chunk doesn't match the stream index (unlikely) */
5
-        if ((startcode & 0x1f) != idx_pkt.stream_index)
6
+        if ((startcode & 0x1f) != s->streams[idx_pkt.stream_index]->id)
7
             break;
8
 
9
         ret = av_grow_packet(pkt, to_read);
10
ffmpeg-2.8.tar.bz2/libavformat/srtdec.c -> ffmpeg-2.8.1.tar.bz2/libavformat/srtdec.c Changed
22
 
1
@@ -41,15 +41,17 @@
2
         ff_text_r8(&tr);
3
 
4
     /* Check if the first non-empty line is a number. We do not check what the
5
-     * number is because in practice it can be anything. */
6
+     * number is because in practice it can be anything.
7
+     * Also, that number can be followed by random garbage, so we can not
8
+     * unfortunately check that we only have a number. */
9
     if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0 ||
10
-        strtol(buf, &pbuf, 10) < 0 || *pbuf)
11
+        strtol(buf, &pbuf, 10) < 0 || pbuf == buf)
12
         return 0;
13
 
14
     /* Check if the next line matches a SRT timestamp */
15
     if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
16
         return 0;
17
-    if (buf[0] >= '0' && buf[1] <= '9' && strstr(buf, " --> ")
18
+    if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
19
         && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
20
         return AVPROBE_SCORE_MAX;
21
 
22
ffmpeg-2.8.tar.bz2/libavformat/webvttenc.c -> ffmpeg-2.8.1.tar.bz2/libavformat/webvttenc.c Changed
16
 
1
@@ -46,8 +46,14 @@
2
 static int webvtt_write_header(AVFormatContext *ctx)
3
 {
4
     AVStream     *s = ctx->streams[0];
5
+    AVCodecContext *avctx = ctx->streams[0]->codec;
6
     AVIOContext *pb = ctx->pb;
7
 
8
+    if (ctx->nb_streams != 1 || avctx->codec_id != AV_CODEC_ID_WEBVTT) {
9
+        av_log(ctx, AV_LOG_ERROR, "Exactly one WebVTT stream is needed.\n");
10
+        return AVERROR(EINVAL);
11
+    }
12
+
13
     avpriv_set_pts_info(s, 64, 1, 1000);
14
 
15
     avio_printf(pb, "WEBVTT\n");
16
ffmpeg-2.8.tar.bz2/libavutil/log.c -> ffmpeg-2.8.1.tar.bz2/libavutil/log.c Changed
10
 
1
@@ -343,7 +343,7 @@
2
 
3
 #if CONFIG_VALGRIND_BACKTRACE
4
     if (level <= BACKTRACE_LOGLEVEL)
5
-        VALGRIND_PRINTF_BACKTRACE("");
6
+        VALGRIND_PRINTF_BACKTRACE("%s", "");
7
 #endif
8
 end:
9
     av_bprint_finalize(part+3, NULL);
10
ffmpeg-2.8.tar.bz2/libswscale/slice.c -> ffmpeg-2.8.1.tar.bz2/libswscale/slice.c Changed
58
 
1
@@ -144,7 +144,7 @@
2
     return 0;
3
 }
4
 
5
-int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH)
6
+int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative)
7
 {
8
     int i = 0;
9
 
10
@@ -158,30 +158,32 @@
11
                         chrY + chrH,
12
                         lumY + lumH};
13
 
14
+    const uint8_t *src_[4] = {src[0] + (relative ? 0 : start[0]) * stride[0],
15
+                             src[1] + (relative ? 0 : start[1]) * stride[0],
16
+                             src[2] + (relative ? 0 : start[2]) * stride[0],
17
+                             src[3] + (relative ? 0 : start[3]) * stride[0]};
18
+
19
     s->width = srcW;
20
 
21
     for (i = 0; i < 4; ++i) {
22
         int j;
23
-        int lines = end[i];
24
-        lines = s->plane[i].available_lines < lines ? s->plane[i].available_lines : lines;
25
+        int first = s->plane[i].sliceY;
26
+        int n = s->plane[i].available_lines;
27
+        int lines = end[i] - start[i];
28
+        int tot_lines = end[i] - first;
29
 
30
-        if (end[i] > s->plane[i].sliceY+s->plane[i].sliceH) {
31
-            if (start[i] <= s->plane[i].sliceY+1)
32
-                s->plane[i].sliceY = FFMIN(start[i], s->plane[i].sliceY);
33
-            else
34
-                s->plane[i].sliceY = start[i];
35
-            s->plane[i].sliceH = end[i] - s->plane[i].sliceY;
36
+        if (start[i] >= first && n >= tot_lines) {
37
+            s->plane[i].sliceH = FFMAX(tot_lines, s->plane[i].sliceH);
38
+            for (j = 0; j < lines; j+= 1)
39
+                s->plane[i].line[start[i] - first + j] = src_[i] +  j * stride[i];
40
         } else {
41
-            if (end[i] >= s->plane[i].sliceY)
42
-                s->plane[i].sliceH = s->plane[i].sliceY + s->plane[i].sliceH - start[i];
43
-            else
44
-                s->plane[i].sliceH = end[i] - start[i];
45
             s->plane[i].sliceY = start[i];
46
+            lines = lines > n ? n : lines;
47
+            s->plane[i].sliceH = lines;
48
+            for (j = 0; j < lines; j+= 1)
49
+                s->plane[i].line[j] = src_[i] +  j * stride[i];
50
         }
51
 
52
-        for (j = start[i]; j < lines; j+= 1)
53
-            s->plane[i].line[j] = src[i] + (start[i] + j) * stride[i];
54
-
55
     }
56
 
57
     return 0;
58
ffmpeg-2.8.tar.bz2/libswscale/swscale.c -> ffmpeg-2.8.1.tar.bz2/libswscale/swscale.c Changed
76
 
1
@@ -359,6 +359,7 @@
2
 #ifndef NEW_FILTER
3
     uint8_t *formatConvBuffer        = c->formatConvBuffer;
4
     uint32_t *pal                    = c->pal_yuv;
5
+    int perform_gamma = c->is_internal_gamma;
6
 #endif
7
     yuv2planar1_fn yuv2plane1        = c->yuv2plane1;
8
     yuv2planarX_fn yuv2planeX        = c->yuv2planeX;
9
@@ -379,7 +380,6 @@
10
     int chrBufIndex  = c->chrBufIndex;
11
     int lastInLumBuf = c->lastInLumBuf;
12
     int lastInChrBuf = c->lastInChrBuf;
13
-    int perform_gamma = c->is_internal_gamma;
14
 
15
 #ifdef NEW_FILTER
16
     int lumStart = 0;
17
@@ -471,22 +471,23 @@
18
                    yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, c->use_mmx_vfilter);
19
 
20
     ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW,
21
-            srcSliceY, srcSliceH, chrSrcSliceY, chrSrcSliceH);
22
+            srcSliceY, srcSliceH, chrSrcSliceY, chrSrcSliceH, 1);
23
 
24
     ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW,
25
             dstY, dstH, dstY >> c->chrDstVSubSample,
26
-            FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample));
27
-
28
-    hout_slice->plane[0].sliceY = lastInLumBuf + 1;
29
-    hout_slice->plane[1].sliceY = lastInChrBuf + 1;
30
-    hout_slice->plane[2].sliceY = lastInChrBuf + 1;
31
-    hout_slice->plane[3].sliceY = lastInLumBuf + 1;
32
-
33
-    hout_slice->plane[0].sliceH =
34
-    hout_slice->plane[1].sliceH =
35
-    hout_slice->plane[2].sliceH =
36
-    hout_slice->plane[3].sliceH = 0;
37
-    hout_slice->width = dstW;
38
+            FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample), 0);
39
+    if (srcSliceY == 0) {
40
+        hout_slice->plane[0].sliceY = lastInLumBuf + 1;
41
+        hout_slice->plane[1].sliceY = lastInChrBuf + 1;
42
+        hout_slice->plane[2].sliceY = lastInChrBuf + 1;
43
+        hout_slice->plane[3].sliceY = lastInLumBuf + 1;
44
+
45
+        hout_slice->plane[0].sliceH =
46
+        hout_slice->plane[1].sliceH =
47
+        hout_slice->plane[2].sliceH =
48
+        hout_slice->plane[3].sliceH = 0;
49
+        hout_slice->width = dstW;
50
+    }
51
 #endif
52
 
53
     for (; dstY < dstH; dstY++) {
54
@@ -522,8 +523,8 @@
55
 #ifdef NEW_FILTER
56
             hasLumHoles = lastInLumBuf != firstLumSrcY - 1;
57
             if (hasLumHoles) {
58
-                hout_slice->plane[0].sliceY = lastInLumBuf + 1;
59
-                hout_slice->plane[3].sliceY = lastInLumBuf + 1;
60
+                hout_slice->plane[0].sliceY = firstLumSrcY;
61
+                hout_slice->plane[3].sliceY = firstLumSrcY;
62
                 hout_slice->plane[0].sliceH =
63
                 hout_slice->plane[3].sliceH = 0;
64
             }
65
@@ -534,8 +535,8 @@
66
 #ifdef NEW_FILTER
67
             hasChrHoles = lastInChrBuf != firstChrSrcY - 1;
68
             if (hasChrHoles) {
69
-                hout_slice->plane[1].sliceY = lastInChrBuf + 1;
70
-                hout_slice->plane[2].sliceY = lastInChrBuf + 1;
71
+                hout_slice->plane[1].sliceY = firstChrSrcY;
72
+                hout_slice->plane[2].sliceY = firstChrSrcY;
73
                 hout_slice->plane[1].sliceH =
74
                 hout_slice->plane[2].sliceH = 0;
75
             }
76
ffmpeg-2.8.tar.bz2/libswscale/swscale_internal.h -> ffmpeg-2.8.1.tar.bz2/libswscale/swscale_internal.h Changed
11
 
1
@@ -1012,7 +1012,8 @@
2
 } VScalerContext;
3
 
4
 // warp input lines in the form (src + width*i + j) to slice format (line[i][j])
5
-int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH);
6
+// relative=true means first line src[x][0] otherwise first line is src[x][lum/crh Y]
7
+int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative);
8
 
9
 // Initialize scaler filter descriptor chain
10
 int ff_init_filters(SwsContext *c);
11
Refresh

No build results available

Refresh

No rpmlint results available

Request History
enzokiel's avatar

enzokiel created request over 9 years ago

- update internal ffmpeg to version 2.8.1


enzokiel's avatar

enzokiel accepted request over 9 years ago

OK.