Overview

Request 2408 (accepted)

- update internal ffmpeg to version 2.8.5

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

avidemux3.changes Changed
x
 
1
@@ -1,5 +1,10 @@
2
 -------------------------------------------------------------------
3
-We Dec 23 13:25:33 UTC 2015 - joerg.lorenzen@ki.tng.de
4
+Mon Jan 18 09:44:37 UTC 2016 - joerg.lorenzen@ki.tng.de
5
+
6
+- update internal ffmpeg to version 2.8.5
7
+
8
+-------------------------------------------------------------------
9
+Wed Dec 23 13:25:33 UTC 2015 - joerg.lorenzen@ki.tng.de
10
 
11
 - update internal ffmpeg to version 2.8.4
12
 
13
avidemux3.spec Changed
10
 
1
@@ -16,7 +16,7 @@
2
 #
3
 
4
 
5
-%define         ffmpeg_version 2.8.4
6
+%define         ffmpeg_version 2.8.5
7
 
8
 Name:           avidemux3
9
 Summary:        Graphical video editing and transcoding tool
10
ffmpeg-2.8.4.tar.bz2/Changelog -> ffmpeg-2.8.5.tar.bz2/Changelog Changed
51
 
1
@@ -1,6 +1,49 @@
2
 Entries are sorted chronologically from oldest to youngest within each release,
3
 releases are sorted from youngest to oldest.
4
 
5
+
6
+version 2.8.5
7
+- avformat/hls: Even stricter URL checks
8
+- avformat/hls: More strict url checks
9
+- avcodec/pngenc: Fix mixed up linesizes
10
+- avcodec/pngenc: Replace memcpy by av_image_copy()
11
+- swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
12
+- swscale: Move VScalerContext into vscale.c
13
+- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
14
+- swscale/yuv2rgb: Increase YUV2RGB table headroom
15
+- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
16
+- avformat/hls: forbid all protocols except http(s) & file
17
+- avformat/aviobuf: Fix end check in put_str16()
18
+- avformat/asfenc: Check pts
19
+- avcodec/mpeg4video: Check time_incr
20
+- avcodec/wavpackenc: Check the number of channels
21
+- avcodec/wavpackenc: Headers are per channel
22
+- avcodec/aacdec_template: Check id_map
23
+- avcodec/dvdec: Fix "left shift of negative value -254"
24
+- avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()
25
+- avcodec/mjpegdec: Fix negative shift
26
+- avcodec/mss2: Check for repeat overflow
27
+- avformat: Add integer fps from 31 to 60 to get_std_framerate()
28
+- avformat/ivfenc: fix division by zero
29
+- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
30
+- avfilter/vf_scale: set proper out frame color range
31
+- avcodec/motion_est: Fix mv_penalty table size
32
+- avcodec/h264_slice: Fix integer overflow in implicit weight computation
33
+- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
34
+- avcodec/put_bits: Always check buffer end before writing
35
+- mjpegdec: extend check for incompatible values of s->rgb and s->ls
36
+- swscale/utils: Fix intermediate format for cascaded alpha downscaling
37
+- avformat/mov: Update handbrake_version threshold for full mp3 parsing
38
+- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
39
+- avfilter/vf_zoompan: do not free frame we pushed to lavfi
40
+- nuv: sanitize negative fps rate
41
+- nutdec: reject negative value_len in read_sm_data
42
+- xwddec: prevent overflow of lsize * avctx->height
43
+- nutdec: only copy the header if it exists
44
+- exr: fix out of bounds read in get_code
45
+- on2avc: limit number of bits to 30 in get_egolomb
46
+
47
+
48
 version 2.8.4
49
 - rawdec: only exempt BIT0 with need_copy from buffer sanity check
50
 - mlvdec: check that index_entries exist
51
ffmpeg-2.8.4.tar.bz2/RELEASE -> ffmpeg-2.8.5.tar.bz2/RELEASE Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8.4
3
+2.8.5
4
ffmpeg-2.8.4.tar.bz2/VERSION -> ffmpeg-2.8.5.tar.bz2/VERSION Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8.4
3
+2.8.5
4
ffmpeg-2.8.4.tar.bz2/configure -> ffmpeg-2.8.5.tar.bz2/configure Changed
10
 
1
@@ -6141,7 +6141,7 @@
2
 #define FFMPEG_CONFIG_H
3
 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
4
 #define FFMPEG_LICENSE "$(c_escape $license)"
5
-#define CONFIG_THIS_YEAR 2015
6
+#define CONFIG_THIS_YEAR 2016
7
 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
8
 #define AVCONV_DATADIR "$(eval c_escape $datadir)"
9
 #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
10
ffmpeg-2.8.4.tar.bz2/doc/Doxyfile -> ffmpeg-2.8.5.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.4
6
+PROJECT_NUMBER         = 2.8.5
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.4.tar.bz2/libavcodec/aacdec_template.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/aacdec_template.c Changed
12
 
1
@@ -449,6 +449,10 @@
2
         int type =         layout_map[i][0];
3
         int id =           layout_map[i][1];
4
         id_map[type][id] = type_counts[type]++;
5
+        if (id_map[type][id] >= MAX_ELEM_ID) {
6
+            avpriv_request_sample(ac->avctx, "Remapped id too large\n");
7
+            return AVERROR_PATCHWELCOME;
8
+        }
9
     }
10
     // Try to sniff a reasonable channel order, otherwise output the
11
     // channels in the order the PCE declared them.
12
ffmpeg-2.8.4.tar.bz2/libavcodec/dvdec.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/dvdec.c Changed
10
 
1
@@ -347,7 +347,7 @@
2
                                     dct_mode                        * 22 * 64 +
3
                                     (quant + ff_dv_quant_offset[class1]) * 64];
4
             }
5
-            dc = dc << 2;
6
+            dc = dc * 4;
7
             /* convert to unsigned because 128 is not added in the
8
              * standard IDCT */
9
             dc                   += 1024;
10
ffmpeg-2.8.4.tar.bz2/libavcodec/exr.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/exr.c Changed
46
 
1
@@ -459,7 +459,7 @@
2
         lc += 8;                                                              \
3
 }
4
 
5
-#define get_code(po, rlc, c, lc, gb, out, oe)                                 \
6
+#define get_code(po, rlc, c, lc, gb, out, oe, outb)                           \
7
 {                                                                             \
8
         if (po == rlc) {                                                      \
9
             if (lc < 8)                                                       \
10
@@ -468,7 +468,7 @@
11
                                                                               \
12
             cs = c >> lc;                                                     \
13
                                                                               \
14
-            if (out + cs > oe)                                                \
15
+            if (out + cs > oe || out == outb)                                 \
16
                 return AVERROR_INVALIDDATA;                                   \
17
                                                                               \
18
             s = out[-1];                                                      \
19
@@ -501,7 +501,7 @@
20
 
21
             if (pl.len) {
22
                 lc -= pl.len;
23
-                get_code(pl.lit, rlc, c, lc, gb, out, oe);
24
+                get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
25
             } else {
26
                 int j;
27
 
28
@@ -518,7 +518,7 @@
29
                         if ((hcode[pl.p[j]] >> 6) ==
30
                             ((c >> (lc - l)) & ((1LL << l) - 1))) {
31
                             lc -= l;
32
-                            get_code(pl.p[j], rlc, c, lc, gb, out, oe);
33
+                            get_code(pl.p[j], rlc, c, lc, gb, out, oe, outb);
34
                             break;
35
                         }
36
                     }
37
@@ -539,7 +539,7 @@
38
 
39
         if (pl.len) {
40
             lc -= pl.len;
41
-            get_code(pl.lit, rlc, c, lc, gb, out, oe);
42
+            get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
43
         } else {
44
             return AVERROR_INVALIDDATA;
45
         }
46
ffmpeg-2.8.4.tar.bz2/libavcodec/g2meet.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/g2meet.c Changed
25
 
1
@@ -631,6 +631,8 @@
2
               (NN  != N)  << 1 |
3
               (NNW != NW);
4
         WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
5
+        if (WWneW < 0)
6
+            return WWneW;
7
     }
8
 
9
     if (WWneW)
10
@@ -837,10 +839,13 @@
11
                 if (y < 2 || x < 2 || x == tile_width - 1) {
12
                     run       = 1;
13
                     got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
14
-                } else
15
+                } else {
16
                     got_pixel = epic_decode_run_length(dc, x, y, tile_width,
17
                                                        curr_row, above_row,
18
                                                        above2_row, &pix, &run);
19
+                    if (got_pixel < 0)
20
+                        return got_pixel;
21
+                }
22
 
23
                 if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
24
                                                            tile_width, curr_row,
25
ffmpeg-2.8.4.tar.bz2/libavcodec/h264_slice.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/h264_slice.c Changed
19
 
1
@@ -783,7 +783,7 @@
2
             cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1];
3
         }
4
         if (sl->ref_count[0] == 1 && sl->ref_count[1] == 1 && !FRAME_MBAFF(h) &&
5
-            sl->ref_list[0][0].poc + sl->ref_list[1][0].poc == 2 * cur_poc) {
6
+            sl->ref_list[0][0].poc + (int64_t)sl->ref_list[1][0].poc == 2 * cur_poc) {
7
             sl->use_weight        = 0;
8
             sl->use_weight_chroma = 0;
9
             return;
10
@@ -804,7 +804,7 @@
11
     sl->chroma_log2_weight_denom = 5;
12
 
13
     for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
14
-        int poc0 = sl->ref_list[0][ref0].poc;
15
+        int64_t poc0 = sl->ref_list[0][ref0].poc;
16
         for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
17
             int w = 32;
18
             if (!sl->ref_list[0][ref0].parent->long_ref && !sl->ref_list[1][ref1].parent->long_ref) {
19
ffmpeg-2.8.4.tar.bz2/libavcodec/ituh263enc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/ituh263enc.c Changed
28
 
1
@@ -45,7 +45,7 @@
2
 /**
3
  * Table of number of bits a motion vector component needs.
4
  */
5
-static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
6
+static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV*2+1];
7
 
8
 /**
9
  * Minimal fcode that a motion vector component would need.
10
@@ -678,7 +678,7 @@
11
     int mv;
12
 
13
     for(f_code=1; f_code<=MAX_FCODE; f_code++){
14
-        for(mv=-MAX_MV; mv<=MAX_MV; mv++){
15
+        for(mv=-MAX_DMV; mv<=MAX_DMV; mv++){
16
             int len;
17
 
18
             if(mv==0) len= ff_mvtab[0][1];
19
@@ -699,7 +699,7 @@
20
                 }
21
             }
22
 
23
-            mv_penalty[f_code][mv+MAX_MV]= len;
24
+            mv_penalty[f_code][mv+MAX_DMV]= len;
25
         }
26
     }
27
 
28
ffmpeg-2.8.4.tar.bz2/libavcodec/mjpegdec.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/mjpegdec.c Changed
20
 
1
@@ -632,7 +632,8 @@
2
         av_log(s->avctx, AV_LOG_DEBUG, "decode_sof0: error, len(%d) mismatch\n", len);
3
     }
4
 
5
-    if (s->rgb && !s->lossless && !s->ls) {
6
+    if ((s->rgb && !s->lossless && !s->ls) ||
7
+        (!s->rgb && s->ls && s->nb_components > 1)) {
8
         av_log(s->avctx, AV_LOG_ERROR, "Unsupported coding and pixel format combination\n");
9
         return AVERROR_PATCHWELCOME;
10
     }
11
@@ -998,7 +999,7 @@
12
                     return -1;
13
 
14
                 left[i] = buffer[mb_x][i] =
15
-                    mask & (pred + (dc << point_transform));
16
+                    mask & (pred + (dc * (1 << point_transform)));
17
             }
18
 
19
             if (s->restart_interval && !--s->restart_count) {
20
ffmpeg-2.8.4.tar.bz2/libavcodec/motion_est.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/motion_est.c Changed
62
 
1
@@ -923,7 +923,7 @@
2
     c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
3
     c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
4
     c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
5
-    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
6
+    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV;
7
 
8
     get_limits(s, 16*mb_x, 16*mb_y);
9
     c->skip=0;
10
@@ -1090,7 +1090,7 @@
11
     av_assert0(s->quarter_sample==0 || s->quarter_sample==1);
12
 
13
     c->pre_penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp);
14
-    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
15
+    c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV;
16
 
17
     get_limits(s, 16*mb_x, 16*mb_y);
18
     c->skip=0;
19
@@ -1139,7 +1139,7 @@
20
     const int shift= 1+s->quarter_sample;
21
     const int mot_stride = s->mb_stride;
22
     const int mot_xy = mb_y*mot_stride + mb_x;
23
-    uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_MV;
24
+    uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_DMV;
25
     int mv_scale;
26
 
27
     c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
28
@@ -1203,8 +1203,8 @@
29
     //FIXME better f_code prediction (max mv & distance)
30
     //FIXME pointers
31
     MotionEstContext * const c= &s->me;
32
-    uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
33
-    uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_MV; // f_code of the prev frame
34
+    uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_DMV; // f_code of the prev frame
35
+    uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_DMV; // f_code of the prev frame
36
     int stride= c->stride;
37
     uint8_t *dest_y = c->scratchpad;
38
     uint8_t *ptr;
39
@@ -1417,7 +1417,7 @@
40
     int mx, my, xmin, xmax, ymin, ymax;
41
     int16_t (*mv_table)[2]= s->b_direct_mv_table;
42
 
43
-    c->current_mv_penalty= c->mv_penalty[1] + MAX_MV;
44
+    c->current_mv_penalty= c->mv_penalty[1] + MAX_DMV;
45
     ymin= xmin=(-32)>>shift;
46
     ymax= xmax=   31>>shift;
47
 
48
@@ -1553,11 +1553,11 @@
49
     if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
50
 //FIXME mb type penalty
51
         c->skip=0;
52
-        c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
53
+        c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV;
54
         fimin= interlaced_search(s, 0,
55
                                  s->b_field_mv_table[0], s->b_field_select_table[0],
56
                                  s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0);
57
-        c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
58
+        c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_DMV;
59
         bimin= interlaced_search(s, 2,
60
                                  s->b_field_mv_table[1], s->b_field_select_table[1],
61
                                  s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0);
62
ffmpeg-2.8.4.tar.bz2/libavcodec/motion_est.h -> ffmpeg-2.8.5.tar.bz2/libavcodec/motion_est.h Changed
18
 
1
@@ -30,6 +30,7 @@
2
 struct MpegEncContext;
3
 
4
 #define MAX_MV 4096
5
+#define MAX_DMV (2*MAX_MV)
6
 
7
 #define FF_ME_ZERO 0
8
 #define FF_ME_EPZS 1
9
@@ -84,7 +85,7 @@
10
     op_pixels_func(*hpel_avg)[4];
11
     qpel_mc_func(*qpel_put)[16];
12
     qpel_mc_func(*qpel_avg)[16];
13
-    uint8_t (*mv_penalty)[MAX_MV * 2 + 1]; ///< bit amount needed to encode a MV
14
+    uint8_t (*mv_penalty)[MAX_DMV * 2 + 1]; ///< bit amount needed to encode a MV
15
     uint8_t *current_mv_penalty;
16
     int (*sub_motion_search)(struct MpegEncContext *s,
17
                              int *mx_ptr, int *my_ptr, int dmin,
18
ffmpeg-2.8.4.tar.bz2/libavcodec/mpeg12enc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/mpeg12enc.c Changed
28
 
1
@@ -53,7 +53,7 @@
2
     0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
3
 };
4
 
5
-static uint8_t mv_penalty[MAX_FCODE + 1][MAX_MV * 2 + 1];
6
+static uint8_t mv_penalty[MAX_FCODE + 1][MAX_DMV * 2 + 1];
7
 static uint8_t fcode_tab[MAX_MV * 2 + 1];
8
 
9
 static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2];
10
@@ -1053,7 +1053,7 @@
11
         }
12
 
13
         for (f_code = 1; f_code <= MAX_FCODE; f_code++)
14
-            for (mv = -MAX_MV; mv <= MAX_MV; mv++) {
15
+            for (mv = -MAX_DMV; mv <= MAX_DMV; mv++) {
16
                 int len;
17
 
18
                 if (mv == 0) {
19
@@ -1076,7 +1076,7 @@
20
                               2 + bit_size;
21
                 }
22
 
23
-                mv_penalty[f_code][mv + MAX_MV] = len;
24
+                mv_penalty[f_code][mv + MAX_DMV] = len;
25
             }
26
 
27
 
28
ffmpeg-2.8.4.tar.bz2/libavcodec/mpeg4video.h -> ffmpeg-2.8.5.tar.bz2/libavcodec/mpeg4video.h Changed
10
 
1
@@ -140,7 +140,7 @@
2
 void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n,
3
                       int dir);
4
 void ff_set_mpeg4_time(MpegEncContext *s);
5
-void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
6
+int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
7
 
8
 int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb);
9
 void ff_mpeg4_encode_video_packet_header(MpegEncContext *s);
10
ffmpeg-2.8.4.tar.bz2/libavcodec/mpeg4videoenc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/mpeg4videoenc.c Changed
32
 
1
@@ -1086,7 +1086,7 @@
2
 }
3
 
4
 /* write mpeg4 VOP header */
5
-void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
6
+int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
7
 {
8
     int time_incr;
9
     int time_div, time_mod;
10
@@ -1112,6 +1112,12 @@
11
     time_mod  = FFUMOD(s->time, s->avctx->time_base.den);
12
     time_incr = time_div - s->last_time_base;
13
     av_assert0(time_incr >= 0);
14
+
15
+    // This limits the frame duration to max 1 hour
16
+    if (time_incr > 3600) {
17
+        av_log(s->avctx, AV_LOG_ERROR, "time_incr %d too large\n", time_incr);
18
+        return AVERROR(EINVAL);
19
+    }
20
     while (time_incr--)
21
         put_bits(&s->pb, 1, 1);
22
 
23
@@ -1137,6 +1143,8 @@
24
         put_bits(&s->pb, 3, s->f_code);  /* fcode_for */
25
     if (s->pict_type == AV_PICTURE_TYPE_B)
26
         put_bits(&s->pb, 3, s->b_code);  /* fcode_back */
27
+
28
+    return 0;
29
 }
30
 
31
 static av_cold void init_uni_dc_tab(void)
32
ffmpeg-2.8.4.tar.bz2/libavcodec/mpegvideo_enc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/mpegvideo_enc.c Changed
33
 
1
@@ -76,7 +76,7 @@
2
 static void denoise_dct_c(MpegEncContext *s, int16_t *block);
3
 static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
4
 
5
-static uint8_t default_mv_penalty[MAX_FCODE + 1][MAX_MV * 2 + 1];
6
+static uint8_t default_mv_penalty[MAX_FCODE + 1][MAX_DMV * 2 + 1];
7
 static uint8_t default_fcode_tab[MAX_MV * 2 + 1];
8
 
9
 const AVOption ff_mpv_generic_options[] = {
10
@@ -342,6 +342,7 @@
11
         break;
12
     }
13
 
14
+    avctx->bits_per_raw_sample = av_clip(avctx->bits_per_raw_sample, 0, 8);
15
     s->bit_rate = avctx->bit_rate;
16
     s->width    = avctx->width;
17
     s->height   = avctx->height;
18
@@ -3765,9 +3766,11 @@
19
             ff_wmv2_encode_picture_header(s, picture_number);
20
         else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
21
             ff_msmpeg4_encode_picture_header(s, picture_number);
22
-        else if (CONFIG_MPEG4_ENCODER && s->h263_pred)
23
-            ff_mpeg4_encode_picture_header(s, picture_number);
24
-        else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10) {
25
+        else if (CONFIG_MPEG4_ENCODER && s->h263_pred) {
26
+            ret = ff_mpeg4_encode_picture_header(s, picture_number);
27
+            if (ret < 0)
28
+                return ret;
29
+        } else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10) {
30
             ret = ff_rv10_encode_picture_header(s, picture_number);
31
             if (ret < 0)
32
                 return ret;
33
ffmpeg-2.8.4.tar.bz2/libavcodec/mss2.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/mss2.c Changed
16
 
1
@@ -210,8 +210,13 @@
2
                     last_symbol = b << 8 | bytestream2_get_byte(gB);
3
                 else if (b > 129) {
4
                     repeat = 0;
5
-                    while (b-- > 130)
6
+                    while (b-- > 130) {
7
+                        if (repeat >= (INT_MAX >> 8) - 1) {
8
+                            av_log(NULL, AV_LOG_ERROR, "repeat overflow\n");
9
+                            return AVERROR_INVALIDDATA;
10
+                        }
11
                         repeat = (repeat << 8) + bytestream2_get_byte(gB) + 1;
12
+                    }
13
                     if (last_symbol == -2) {
14
                         int skip = FFMIN((unsigned)repeat, dst + w - p);
15
                         repeat -= skip;
16
ffmpeg-2.8.4.tar.bz2/libavcodec/on2avc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/on2avc.c Changed
20
 
1
@@ -211,9 +211,16 @@
2
 {
3
     int v = 4;
4
 
5
-    while (get_bits1(gb)) v++;
6
+    while (get_bits1(gb)) {
7
+        v++;
8
+        if (v > 30) {
9
+            av_log(NULL, AV_LOG_WARNING, "Too large golomb code in get_egolomb.\n");
10
+            v = 30;
11
+            break;
12
+        }
13
+    }
14
 
15
-    return (1 << v) + get_bits(gb, v);
16
+    return (1 << v) + get_bits_long(gb, v);
17
 }
18
 
19
 static int on2avc_decode_pairs(On2AVCContext *c, GetBitContext *gb, float *dst,
20
ffmpeg-2.8.4.tar.bz2/libavcodec/pngenc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/pngenc.c Changed
42
 
1
@@ -747,12 +747,11 @@
2
 
3
             // Do disposal
4
             if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
5
-                memcpy(diffFrame->data[0], s->last_frame->data[0],
6
-                       s->last_frame->linesize[0] * s->last_frame->height);
7
+                av_frame_copy(diffFrame, s->last_frame);
8
 
9
                 if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
10
                     for (y = last_fctl_chunk.y_offset; y < last_fctl_chunk.y_offset + last_fctl_chunk.height; ++y) {
11
-                        size_t row_start = s->last_frame->linesize[0] * y + bpp * last_fctl_chunk.x_offset;
12
+                        size_t row_start = diffFrame->linesize[0] * y + bpp * last_fctl_chunk.x_offset;
13
                         memset(diffFrame->data[0] + row_start, 0, bpp * last_fctl_chunk.width);
14
                     }
15
                 }
16
@@ -760,8 +759,7 @@
17
                 if (!s->prev_frame)
18
                     continue;
19
 
20
-                memcpy(diffFrame->data[0], s->prev_frame->data[0],
21
-                       s->prev_frame->linesize[0] * s->prev_frame->height);
22
+                av_frame_copy(diffFrame, s->prev_frame);
23
             }
24
 
25
             // Do inverse blending
26
@@ -923,13 +921,12 @@
27
             }
28
 
29
             // Do disposal, but not blending
30
-            memcpy(s->prev_frame->data[0], s->last_frame->data[0],
31
-                   s->last_frame->linesize[0] * s->last_frame->height);
32
+            av_frame_copy(s->prev_frame, s->last_frame);
33
             if (s->last_frame_fctl.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
34
                 uint32_t y;
35
                 uint8_t bpp = (s->bits_per_pixel + 7) >> 3;
36
                 for (y = s->last_frame_fctl.y_offset; y < s->last_frame_fctl.y_offset + s->last_frame_fctl.height; ++y) {
37
-                    size_t row_start = s->last_frame->linesize[0] * y + bpp * s->last_frame_fctl.x_offset;
38
+                    size_t row_start = s->prev_frame->linesize[0] * y + bpp * s->last_frame_fctl.x_offset;
39
                     memset(s->prev_frame->data[0] + row_start, 0, bpp * s->last_frame_fctl.width);
40
                 }
41
             }
42
ffmpeg-2.8.4.tar.bz2/libavcodec/put_bits.h -> ffmpeg-2.8.5.tar.bz2/libavcodec/put_bits.h Changed
35
 
1
@@ -163,9 +163,13 @@
2
 #ifdef BITSTREAM_WRITER_LE
3
     bit_buf |= value << (32 - bit_left);
4
     if (n >= bit_left) {
5
-        av_assert2(s->buf_ptr+3<s->buf_end);
6
-        AV_WL32(s->buf_ptr, bit_buf);
7
-        s->buf_ptr += 4;
8
+        if (3 < s->buf_end - s->buf_ptr) {
9
+            AV_WL32(s->buf_ptr, bit_buf);
10
+            s->buf_ptr += 4;
11
+        } else {
12
+            av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n");
13
+            av_assert2(0);
14
+        }
15
         bit_buf     = value >> bit_left;
16
         bit_left   += 32;
17
     }
18
@@ -177,9 +181,13 @@
19
     } else {
20
         bit_buf   <<= bit_left;
21
         bit_buf    |= value >> (n - bit_left);
22
-        av_assert2(s->buf_ptr+3<s->buf_end);
23
-        AV_WB32(s->buf_ptr, bit_buf);
24
-        s->buf_ptr += 4;
25
+        if (3 < s->buf_end - s->buf_ptr) {
26
+            AV_WB32(s->buf_ptr, bit_buf);
27
+            s->buf_ptr += 4;
28
+        } else {
29
+            av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n");
30
+            av_assert2(0);
31
+        }
32
         bit_left   += 32 - n;
33
         bit_buf     = value;
34
     }
35
ffmpeg-2.8.4.tar.bz2/libavcodec/snowenc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/snowenc.c Changed
10
 
1
@@ -291,7 +291,7 @@
2
     c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
3
     c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
4
     c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
5
-    c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_MV;
6
+    c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_DMV;
7
 
8
     c->xmin = - x*block_w - 16+3;
9
     c->ymin = - y*block_w - 16+3;
10
ffmpeg-2.8.4.tar.bz2/libavcodec/wavpackenc.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/wavpackenc.c Changed
22
 
1
@@ -128,6 +128,11 @@
2
 
3
     s->avctx = avctx;
4
 
5
+    if (avctx->channels > 255) {
6
+        av_log(avctx, AV_LOG_ERROR, "Invalid channel count: %d\n", avctx->channels);
7
+        return AVERROR(EINVAL);
8
+    }
9
+
10
     if (!avctx->frame_size) {
11
         int block_samples;
12
         if (!(avctx->sample_rate & 1))
13
@@ -2878,7 +2883,7 @@
14
     }
15
 
16
     buf_size = s->block_samples * avctx->channels * 8
17
-             + 200 /* for headers */;
18
+             + 200 * avctx->channels /* for headers */;
19
     if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size, 0)) < 0)
20
         return ret;
21
     buf = avpkt->data;
22
ffmpeg-2.8.4.tar.bz2/libavcodec/xwddec.c -> ffmpeg-2.8.5.tar.bz2/libavcodec/xwddec.c Changed
10
 
1
@@ -141,7 +141,7 @@
2
         return AVERROR_INVALIDDATA;
3
     }
4
 
5
-    if (bytestream2_get_bytes_left(&gb) < ncolors * XWD_CMAP_SIZE + avctx->height * lsize) {
6
+    if (bytestream2_get_bytes_left(&gb) < ncolors * XWD_CMAP_SIZE + (uint64_t)avctx->height * lsize) {
7
         av_log(avctx, AV_LOG_ERROR, "input buffer too small\n");
8
         return AVERROR_INVALIDDATA;
9
     }
10
ffmpeg-2.8.4.tar.bz2/libavfilter/vf_scale.c -> ffmpeg-2.8.5.tar.bz2/libavfilter/vf_scale.c Changed
10
 
1
@@ -565,6 +565,8 @@
2
             sws_setColorspaceDetails(scale->isws[1], inv_table, in_full,
3
                                      table, out_full,
4
                                      brightness, contrast, saturation);
5
+
6
+        av_frame_set_color_range(out, out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG);
7
     }
8
 
9
     av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
10
ffmpeg-2.8.4.tar.bz2/libavfilter/vf_zoompan.c -> ffmpeg-2.8.5.tar.bz2/libavfilter/vf_zoompan.c Changed
12
 
1
@@ -230,9 +230,9 @@
2
         s->frame_count++;
3
 
4
         ret = ff_filter_frame(outlink, out);
5
+        out = NULL;
6
         if (ret < 0)
7
             break;
8
-        out = NULL;
9
 
10
         sws_freeContext(s->sws);
11
         s->sws = NULL;
12
ffmpeg-2.8.4.tar.bz2/libavformat/asfenc.c -> ffmpeg-2.8.5.tar.bz2/libavformat/asfenc.c Changed
13
 
1
@@ -959,6 +959,11 @@
2
 
3
     pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
4
     av_assert0(pts != AV_NOPTS_VALUE);
5
+    if (   pts < - PREROLL_TIME
6
+        || pts > (INT_MAX-3)/10000LL * ASF_INDEXED_INTERVAL - PREROLL_TIME) {
7
+        av_log(s, AV_LOG_ERROR, "input pts %"PRId64" is invalid\n", pts);
8
+        return AVERROR(EINVAL);
9
+    }
10
     pts *= 10000;
11
     asf->duration = FFMAX(asf->duration, pts + pkt->duration * 10000);
12
 
13
ffmpeg-2.8.4.tar.bz2/libavformat/avformat.h -> ffmpeg-2.8.5.tar.bz2/libavformat/avformat.h Changed
10
 
1
@@ -968,7 +968,7 @@
2
     /**
3
      * Stream information used internally by av_find_stream_info()
4
      */
5
-#define MAX_STD_TIMEBASES (30*12+7+6)
6
+#define MAX_STD_TIMEBASES (30*12+30+3+6)
7
     struct {
8
         int64_t last_dts;
9
         int64_t duration_gcd;
10
ffmpeg-2.8.4.tar.bz2/libavformat/aviobuf.c -> ffmpeg-2.8.5.tar.bz2/libavformat/aviobuf.c Changed
10
 
1
@@ -360,6 +360,8 @@
2
 invalid:
3
         av_log(s, AV_LOG_ERROR, "Invaid UTF8 sequence in avio_put_str16%s\n", be ? "be" : "le");
4
         err = AVERROR(EINVAL);
5
+        if (!*(q-1))
6
+            break;
7
     }
8
     if (be)
9
         avio_wb16(s, 0);
10
ffmpeg-2.8.4.tar.bz2/libavformat/hls.c -> ffmpeg-2.8.5.tar.bz2/libavformat/hls.c Changed
20
 
1
@@ -618,6 +618,18 @@
2
 {
3
     AVDictionary *tmp = NULL;
4
     int ret;
5
+    const char *proto_name = avio_find_protocol_name(url);
6
+
7
+    if (!proto_name)
8
+        return AVERROR_INVALIDDATA;
9
+
10
+    // only http(s) & file are allowed
11
+    if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL))
12
+        return AVERROR_INVALIDDATA;
13
+    if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
14
+        ;
15
+    else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
16
+        return AVERROR_INVALIDDATA;
17
 
18
     av_dict_copy(&tmp, c->avio_opts, 0);
19
     av_dict_copy(&tmp, opts, 0);
20
ffmpeg-2.8.4.tar.bz2/libavformat/ivfenc.c -> ffmpeg-2.8.5.tar.bz2/libavformat/ivfenc.c Changed
13
 
1
@@ -72,8 +72,9 @@
2
 static int ivf_write_trailer(AVFormatContext *s)
3
 {
4
     AVIOContext *pb = s->pb;
5
-    if (pb->seekable) {
6
-        IVFEncContext *ctx = s->priv_data;
7
+    IVFEncContext *ctx = s->priv_data;
8
+
9
+    if (pb->seekable && ctx->frame_cnt > 1) {
10
         size_t end = avio_tell(pb);
11
 
12
         avio_seek(pb, 24, SEEK_SET);
13
ffmpeg-2.8.4.tar.bz2/libavformat/mov.c -> ffmpeg-2.8.5.tar.bz2/libavformat/mov.c Changed
10
 
1
@@ -4535,7 +4535,7 @@
2
             }
3
         }
4
         if (mov->handbrake_version &&
5
-            mov->handbrake_version <= 1000000*0 + 1000*10 + 0 &&  // 0.10.0
6
+            mov->handbrake_version <= 1000000*0 + 1000*10 + 2 &&  // 0.10.2
7
             st->codec->codec_id == AV_CODEC_ID_MP3
8
         ) {
9
             av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n");
10
ffmpeg-2.8.4.tar.bz2/libavformat/nutdec.c -> ffmpeg-2.8.5.tar.bz2/libavformat/nutdec.c Changed
20
 
1
@@ -927,7 +927,7 @@
2
                 return ret;
3
             }
4
             value_len = ffio_read_varlen(bc);
5
-            if (avio_tell(bc) + value_len >= maxpos)
6
+            if (value_len < 0 || value_len >= maxpos - avio_tell(bc))
7
                 return AVERROR_INVALIDDATA;
8
             if (!strcmp(name, "Palette")) {
9
                 dst = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, value_len);
10
@@ -1126,7 +1126,8 @@
11
     ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
12
     if (ret < 0)
13
         return ret;
14
-    memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
15
+    if (nut->header[header_idx])
16
+        memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
17
     pkt->pos = avio_tell(bc); // FIXME
18
     if (stc->last_flags & FLAG_SM_DATA) {
19
         int sm_size;
20
ffmpeg-2.8.4.tar.bz2/libavformat/nuv.c -> ffmpeg-2.8.5.tar.bz2/libavformat/nuv.c Changed
17
 
1
@@ -172,6 +172,15 @@
2
     if (aspect > 0.9999 && aspect < 1.0001)
3
         aspect = 4.0 / 3.0;
4
     fps = av_int2double(avio_rl64(pb));
5
+    if (fps < 0.0f) {
6
+        if (s->error_recognition & AV_EF_EXPLODE) {
7
+            av_log(s, AV_LOG_ERROR, "Invalid frame rate %f\n", fps);
8
+            return AVERROR_INVALIDDATA;
9
+        } else {
10
+            av_log(s, AV_LOG_WARNING, "Invalid frame rate %f, setting to 0.\n", fps);
11
+            fps = 0.0f;
12
+        }
13
+    }
14
 
15
     // number of packets per stream type, -1 means unknown, e.g. streaming
16
     v_packs = avio_rl32(pb);
17
ffmpeg-2.8.4.tar.bz2/libavformat/utils.c -> ffmpeg-2.8.5.tar.bz2/libavformat/utils.c Changed
19
 
1
@@ -2892,10 +2892,14 @@
2
         return (i + 1) * 1001;
3
     i -= 30*12;
4
 
5
-    if (i < 7)
6
-        return ((const int[]) { 40, 48, 50, 60, 80, 120, 240})[i] * 1001 * 12;
7
+    if (i < 30)
8
+        return (i + 31) * 1001 * 12;
9
+    i -= 30;
10
 
11
-    i -= 7;
12
+    if (i < 3)
13
+        return ((const int[]) { 80, 120, 240})[i] * 1001 * 12;
14
+
15
+    i -= 3;
16
 
17
     return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i] * 1000 * 12;
18
 }
19
ffmpeg-2.8.4.tar.bz2/libavutil/x86/float_dsp.asm -> ffmpeg-2.8.5.tar.bz2/libavutil/x86/float_dsp.asm Changed
15
 
1
@@ -332,10 +332,10 @@
2
 ; float scalarproduct_float_sse(const float *v1, const float *v2, int len)
3
 INIT_XMM sse
4
 cglobal scalarproduct_float, 3,3,2, v1, v2, offset
5
+    shl   offsetd, 2
6
+    add       v1q, offsetq
7
+    add       v2q, offsetq
8
     neg   offsetq
9
-    shl   offsetq, 2
10
-    sub       v1q, offsetq
11
-    sub       v2q, offsetq
12
     xorps    xmm0, xmm0
13
 .loop:
14
     movaps   xmm1, [v1q+offsetq]
15
ffmpeg-2.8.4.tar.bz2/libswscale/swscale_internal.h -> ffmpeg-2.8.5.tar.bz2/libswscale/swscale_internal.h Changed
35
 
1
@@ -39,7 +39,8 @@
2
 
3
 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
4
 
5
-#define YUVRGB_TABLE_HEADROOM 256
6
+#define YUVRGB_TABLE_HEADROOM 512
7
+#define YUVRGB_TABLE_LUMA_HEADROOM 512
8
 
9
 #define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
10
 
11
@@ -396,6 +397,7 @@
12
     uint8_t *chrMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
13
 
14
     int canMMXEXTBeUsed;
15
+    int warned_unuseable_bilinear;
16
 
17
     int dstY;                     ///< Last destination vertical line output from last slice.
18
     int flags;                    ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
19
@@ -1002,15 +1004,6 @@
20
     int xInc;
21
 } FilterContext;
22
 
23
-typedef struct VScalerContext
24
-{
25
-    uint16_t *filter[2];
26
-    int32_t  *filter_pos;
27
-    int filter_size;
28
-    int isMMX;
29
-    void *pfn;
30
-} VScalerContext;
31
-
32
 // warp input lines in the form (src + width*i + j) to slice format (line[i][j])
33
 // relative=true means first line src[x][0] otherwise first line is src[x][lum/crh Y]
34
 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);
35
ffmpeg-2.8.4.tar.bz2/libswscale/utils.c -> ffmpeg-2.8.5.tar.bz2/libswscale/utils.c Changed
70
 
1
@@ -830,8 +830,6 @@
2
     const AVPixFmtDescriptor *desc_dst;
3
     const AVPixFmtDescriptor *desc_src;
4
     int need_reinit = 0;
5
-    memmove(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
6
-    memmove(c->dstColorspaceTable, table, sizeof(int) * 4);
7
 
8
     handle_formats(c);
9
     desc_dst = av_pix_fmt_desc_get(c->dstFormat);
10
@@ -842,11 +840,24 @@
11
     if(!isYUV(c->srcFormat) && !isGray(c->srcFormat))
12
         srcRange = 0;
13
 
14
+    if (c->srcRange != srcRange ||
15
+        c->dstRange != dstRange ||
16
+        c->brightness != brightness ||
17
+        c->contrast   != contrast ||
18
+        c->saturation != saturation ||
19
+        memcmp(c->srcColorspaceTable, inv_table, sizeof(int) * 4) ||
20
+        memcmp(c->dstColorspaceTable,     table, sizeof(int) * 4)
21
+    )
22
+        need_reinit = 1;
23
+
24
+    memmove(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
25
+    memmove(c->dstColorspaceTable, table, sizeof(int) * 4);
26
+
27
+
28
+
29
     c->brightness = brightness;
30
     c->contrast   = contrast;
31
     c->saturation = saturation;
32
-    if (c->srcRange != srcRange || c->dstRange != dstRange)
33
-        need_reinit = 1;
34
     c->srcRange   = srcRange;
35
     c->dstRange   = dstRange;
36
 
37
@@ -861,6 +872,9 @@
38
     if (c->cascaded_context[0])
39
         return sws_setColorspaceDetails(c->cascaded_context[0],inv_table, srcRange,table, dstRange, brightness,  contrast, saturation);
40
 
41
+    if (!need_reinit)
42
+        return 0;
43
+
44
     if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) {
45
         if (!c->cascaded_context[0] &&
46
             memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) &&
47
@@ -1193,6 +1207,12 @@
48
                srcW, srcH, dstW, dstH);
49
         return AVERROR(EINVAL);
50
     }
51
+    if (flags & SWS_FAST_BILINEAR) {
52
+        if (srcW < 8 || dstW < 8) {
53
+            flags ^= SWS_FAST_BILINEAR | SWS_BILINEAR;
54
+            c->flags = flags;
55
+        }
56
+    }
57
 
58
     if (!dstFilter)
59
         dstFilter = &dummyFilter;
60
@@ -1786,6 +1806,9 @@
61
         int tmpH = sqrt(srcH * (int64_t)dstH);
62
         enum AVPixelFormat tmpFormat = AV_PIX_FMT_YUV420P;
63
 
64
+        if (isALPHA(srcFormat))
65
+            tmpFormat = AV_PIX_FMT_YUVA420P;
66
+
67
         if (srcW*(int64_t)srcH <= 4LL*dstW*dstH)
68
             return AVERROR(EINVAL);
69
 
70
ffmpeg-2.8.4.tar.bz2/libswscale/vscale.c -> ffmpeg-2.8.5.tar.bz2/libswscale/vscale.c Changed
71
 
1
@@ -19,6 +19,17 @@
2
  */
3
 #include "swscale_internal.h"
4
 
5
+typedef struct VScalerContext
6
+{
7
+    uint16_t *filter[2];
8
+    int32_t  *filter_pos;
9
+    int filter_size;
10
+    int isMMX;
11
+    void *pfn;
12
+    yuv2packedX_fn yuv2packedX;
13
+} VScalerContext;
14
+
15
+
16
 static int lum_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
17
 {
18
     VScalerContext *inst = desc->instance;
19
@@ -113,10 +124,21 @@
20
     uint8_t **dst = desc->dst->plane[0].line + dp;
21
 
22
 
23
-    if (c->yuv2packed1 && lum_fsize == 1 && chr_fsize <= 2) { // unscaled RGB
24
-        int chrAlpha = chr_fsize == 1 ? 0 : chr_filter[2 * sliceY + 1];
25
-        ((yuv2packed1_fn)inst->pfn)(c, (const int16_t*)*src0, (const int16_t**)src1, (const int16_t**)src2, (const int16_t*)(desc->alpha ? *src3 : NULL),  *dst, dstW, chrAlpha, sliceY);
26
-    } else if (c->yuv2packed2 && lum_fsize == 2 && chr_fsize == 2) { // bilinear upscale RGB
27
+    if (c->yuv2packed1 && lum_fsize == 1 && chr_fsize == 1) { // unscaled RGB
28
+        ((yuv2packed1_fn)inst->pfn)(c, (const int16_t*)*src0, (const int16_t**)src1, (const int16_t**)src2,
29
+                                    (const int16_t*)(desc->alpha ? *src3 : NULL),  *dst, dstW, 0, sliceY);
30
+    } else if (c->yuv2packed1 && lum_fsize == 1 && chr_fsize == 2 &&
31
+               chr_filter[2 * sliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
32
+               chr_filter[2 * sliceY + 1] <= 4096U) { // unscaled RGB
33
+        int chrAlpha = chr_filter[2 * sliceY + 1];
34
+        ((yuv2packed1_fn)inst->pfn)(c, (const int16_t*)*src0, (const int16_t**)src1, (const int16_t**)src2,
35
+                                    (const int16_t*)(desc->alpha ? *src3 : NULL),  *dst, dstW, chrAlpha, sliceY);
36
+    } else if (c->yuv2packed2 && lum_fsize == 2 && chr_fsize == 2 &&
37
+               lum_filter[2 * sliceY + 1] + lum_filter[2 * sliceY] == 4096 &&
38
+               lum_filter[2 * sliceY + 1] <= 4096U &&
39
+               chr_filter[2 * chrSliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
40
+               chr_filter[2 * chrSliceY + 1] <= 4096U
41
+    ) { // bilinear upscale RGB
42
         int lumAlpha = lum_filter[2 * sliceY + 1];
43
         int chrAlpha = chr_filter[2 * sliceY + 1];
44
         c->lumMmxFilter[2] =
45
@@ -126,7 +148,14 @@
46
         ((yuv2packed2_fn)inst->pfn)(c, (const int16_t**)src0, (const int16_t**)src1, (const int16_t**)src2, (const int16_t**)src3,
47
                     *dst, dstW, lumAlpha, chrAlpha, sliceY);
48
     } else { // general RGB
49
-        ((yuv2packedX_fn)inst->pfn)(c, lum_filter + sliceY * lum_fsize,
50
+        if ((c->yuv2packed1 && lum_fsize == 1 && chr_fsize == 2) ||
51
+            (c->yuv2packed2 && lum_fsize == 2 && chr_fsize == 2)) {
52
+            if (!c->warned_unuseable_bilinear)
53
+                av_log(c, AV_LOG_INFO, "Optimized 2 tap filter code cannot be used\n");
54
+            c->warned_unuseable_bilinear = 1;
55
+        }
56
+
57
+        inst->yuv2packedX(c, lum_filter + sliceY * lum_fsize,
58
                     (const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
59
                     (const int16_t**)src1, (const int16_t**)src2, chr_fsize, (const int16_t**)src3, *dst, dstW, sliceY);
60
     }
61
@@ -277,8 +306,7 @@
62
                 lumCtx->pfn = yuv2packed1;
63
             else if (c->yuv2packed2 && c->vLumFilterSize == 2 && c->vChrFilterSize == 2)
64
                 lumCtx->pfn = yuv2packed2;
65
-            else
66
-                lumCtx->pfn = yuv2packedX;
67
+            lumCtx->yuv2packedX = yuv2packedX;
68
         } else
69
             lumCtx->pfn = yuv2anyX;
70
     }
71
ffmpeg-2.8.4.tar.bz2/libswscale/yuv2rgb.c -> ffmpeg-2.8.5.tar.bz2/libswscale/yuv2rgb.c Changed
178
 
1
@@ -776,7 +776,8 @@
2
     uint16_t *y_table16;
3
     uint32_t *y_table32;
4
     int i, base, rbase, gbase, bbase, av_uninit(abase), needAlpha;
5
-    const int yoffs = fullRange ? 384 : 326;
6
+    const int yoffs = (fullRange ? 384 : 326) + YUVRGB_TABLE_LUMA_HEADROOM;
7
+    const int table_plane_size = 1024 + 2*YUVRGB_TABLE_LUMA_HEADROOM;
8
 
9
     int64_t crv =  inv_table[0];
10
     int64_t cbu =  inv_table[1];
11
@@ -833,10 +834,10 @@
12
             return AVERROR(ENOMEM);
13
     switch (bpp) {
14
     case 1:
15
-        ALLOC_YUV_TABLE(1024);
16
+        ALLOC_YUV_TABLE(table_plane_size);
17
         y_table     = c->yuvTable;
18
-        yb = -(384 << 16) - oy;
19
-        for (i = 0; i < 1024 - 110; i++) {
20
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
21
+        for (i = 0; i < table_plane_size - 110; i++) {
22
             y_table[i + 110]  = av_clip_uint8((yb + 0x8000) >> 16) >> 7;
23
             yb               += cy;
24
         }
25
@@ -848,60 +849,60 @@
26
         rbase       = isRgb ? 3 : 0;
27
         gbase       = 1;
28
         bbase       = isRgb ? 0 : 3;
29
-        ALLOC_YUV_TABLE(1024 * 3);
30
+        ALLOC_YUV_TABLE(table_plane_size * 3);
31
         y_table     = c->yuvTable;
32
-        yb = -(384 << 16) - oy;
33
-        for (i = 0; i < 1024 - 110; i++) {
34
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
35
+        for (i = 0; i < table_plane_size - 110; i++) {
36
             int yval                = av_clip_uint8((yb + 0x8000) >> 16);
37
             y_table[i + 110]        = (yval >> 7)        << rbase;
38
-            y_table[i +  37 + 1024] = ((yval + 43) / 85) << gbase;
39
-            y_table[i + 110 + 2048] = (yval >> 7)        << bbase;
40
+            y_table[i +  37 +   table_plane_size] = ((yval + 43) / 85) << gbase;
41
+            y_table[i + 110 + 2*table_plane_size] = (yval >> 7)        << bbase;
42
             yb += cy;
43
         }
44
         fill_table(c->table_rV, 1, crv, y_table + yoffs);
45
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs + 1024);
46
-        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2048);
47
+        fill_table(c->table_gU, 1, cgu, y_table + yoffs +   table_plane_size);
48
+        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size);
49
         fill_gv_table(c->table_gV, 1, cgv);
50
         break;
51
     case 8:
52
         rbase       = isRgb ? 5 : 0;
53
         gbase       = isRgb ? 2 : 3;
54
         bbase       = isRgb ? 0 : 6;
55
-        ALLOC_YUV_TABLE(1024 * 3);
56
+        ALLOC_YUV_TABLE(table_plane_size * 3);
57
         y_table     = c->yuvTable;
58
-        yb = -(384 << 16) - oy;
59
-        for (i = 0; i < 1024 - 38; i++) {
60
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
61
+        for (i = 0; i < table_plane_size - 38; i++) {
62
             int yval               = av_clip_uint8((yb + 0x8000) >> 16);
63
             y_table[i + 16]        = ((yval + 18) / 36) << rbase;
64
-            y_table[i + 16 + 1024] = ((yval + 18) / 36) << gbase;
65
-            y_table[i + 37 + 2048] = ((yval + 43) / 85) << bbase;
66
+            y_table[i + 16 +   table_plane_size] = ((yval + 18) / 36) << gbase;
67
+            y_table[i + 37 + 2*table_plane_size] = ((yval + 43) / 85) << bbase;
68
             yb += cy;
69
         }
70
         fill_table(c->table_rV, 1, crv, y_table + yoffs);
71
-        fill_table(c->table_gU, 1, cgu, y_table + yoffs + 1024);
72
-        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2048);
73
+        fill_table(c->table_gU, 1, cgu, y_table + yoffs +   table_plane_size);
74
+        fill_table(c->table_bU, 1, cbu, y_table + yoffs + 2*table_plane_size);
75
         fill_gv_table(c->table_gV, 1, cgv);
76
         break;
77
     case 12:
78
         rbase       = isRgb ? 8 : 0;
79
         gbase       = 4;
80
         bbase       = isRgb ? 0 : 8;
81
-        ALLOC_YUV_TABLE(1024 * 3 * 2);
82
+        ALLOC_YUV_TABLE(table_plane_size * 3 * 2);
83
         y_table16   = c->yuvTable;
84
-        yb = -(384 << 16) - oy;
85
-        for (i = 0; i < 1024; i++) {
86
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
87
+        for (i = 0; i < table_plane_size; i++) {
88
             uint8_t yval        = av_clip_uint8((yb + 0x8000) >> 16);
89
             y_table16[i]        = (yval >> 4) << rbase;
90
-            y_table16[i + 1024] = (yval >> 4) << gbase;
91
-            y_table16[i + 2048] = (yval >> 4) << bbase;
92
+            y_table16[i +   table_plane_size] = (yval >> 4) << gbase;
93
+            y_table16[i + 2*table_plane_size] = (yval >> 4) << bbase;
94
             yb += cy;
95
         }
96
         if (isNotNe)
97
-            for (i = 0; i < 1024 * 3; i++)
98
+            for (i = 0; i < table_plane_size * 3; i++)
99
                 y_table16[i] = av_bswap16(y_table16[i]);
100
         fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
101
-        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
102
-        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);
103
+        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs +   table_plane_size);
104
+        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size);
105
         fill_gv_table(c->table_gV, 2, cgv);
106
         break;
107
     case 15:
108
@@ -909,30 +910,30 @@
109
         rbase       = isRgb ? bpp - 5 : 0;
110
         gbase       = 5;
111
         bbase       = isRgb ? 0 : (bpp - 5);
112
-        ALLOC_YUV_TABLE(1024 * 3 * 2);
113
+        ALLOC_YUV_TABLE(table_plane_size * 3 * 2);
114
         y_table16   = c->yuvTable;
115
-        yb = -(384 << 16) - oy;
116
-        for (i = 0; i < 1024; i++) {
117
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
118
+        for (i = 0; i < table_plane_size; i++) {
119
             uint8_t yval        = av_clip_uint8((yb + 0x8000) >> 16);
120
             y_table16[i]        = (yval >> 3)          << rbase;
121
-            y_table16[i + 1024] = (yval >> (18 - bpp)) << gbase;
122
-            y_table16[i + 2048] = (yval >> 3)          << bbase;
123
+            y_table16[i +   table_plane_size] = (yval >> (18 - bpp)) << gbase;
124
+            y_table16[i + 2*table_plane_size] = (yval >> 3)          << bbase;
125
             yb += cy;
126
         }
127
         if (isNotNe)
128
-            for (i = 0; i < 1024 * 3; i++)
129
+            for (i = 0; i < table_plane_size * 3; i++)
130
                 y_table16[i] = av_bswap16(y_table16[i]);
131
         fill_table(c->table_rV, 2, crv, y_table16 + yoffs);
132
-        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs + 1024);
133
-        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2048);
134
+        fill_table(c->table_gU, 2, cgu, y_table16 + yoffs +   table_plane_size);
135
+        fill_table(c->table_bU, 2, cbu, y_table16 + yoffs + 2*table_plane_size);
136
         fill_gv_table(c->table_gV, 2, cgv);
137
         break;
138
     case 24:
139
     case 48:
140
-        ALLOC_YUV_TABLE(1024);
141
+        ALLOC_YUV_TABLE(table_plane_size);
142
         y_table     = c->yuvTable;
143
-        yb = -(384 << 16) - oy;
144
-        for (i = 0; i < 1024; i++) {
145
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
146
+        for (i = 0; i < table_plane_size; i++) {
147
             y_table[i]  = av_clip_uint8((yb + 0x8000) >> 16);
148
             yb         += cy;
149
         }
150
@@ -951,20 +952,20 @@
151
         needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
152
         if (!needAlpha)
153
             abase = (base + 24) & 31;
154
-        ALLOC_YUV_TABLE(1024 * 3 * 4);
155
+        ALLOC_YUV_TABLE(table_plane_size * 3 * 4);
156
         y_table32   = c->yuvTable;
157
-        yb = -(384 << 16) - oy;
158
-        for (i = 0; i < 1024; i++) {
159
+        yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy;
160
+        for (i = 0; i < table_plane_size; i++) {
161
             unsigned yval       = av_clip_uint8((yb + 0x8000) >> 16);
162
             y_table32[i]        = (yval << rbase) +
163
                                   (needAlpha ? 0 : (255u << abase));
164
-            y_table32[i + 1024] =  yval << gbase;
165
-            y_table32[i + 2048] =  yval << bbase;
166
+            y_table32[i +   table_plane_size] =  yval << gbase;
167
+            y_table32[i + 2*table_plane_size] =  yval << bbase;
168
             yb += cy;
169
         }
170
         fill_table(c->table_rV, 4, crv, y_table32 + yoffs);
171
-        fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + 1024);
172
-        fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2048);
173
+        fill_table(c->table_gU, 4, cgu, y_table32 + yoffs +   table_plane_size);
174
+        fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2*table_plane_size);
175
         fill_gv_table(c->table_gV, 4, cgv);
176
         break;
177
     default:
178
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.5


enzokiel's avatar

enzokiel accepted request over 9 years ago

OK.