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