History

Merge remote-tracking branch 'qatar/master'

* qatar/master: (22 commits) frwu: Employ more meaningful return values. fraps: Use av_fast_padded_malloc() instead of av_realloc() mjpegdec: use av_fast_padded_malloc() eatqi: use av_fast_padded_malloc() asv1: use av_fast_padded_malloc() avcodec: Add av_fast_padded_malloc(). swscale: enable dithering in MMX functions. swscale: make rgb24 function macros slightly smaller. avcodec.h: Remove some disabled cruft. swscale: remove obsolete comment. swscale-test: Drop unused argc and argv arguments from main(). zmbv: Employ more meaningful return values. zmbvenc: Employ more meaningful return values. vc1: prevent null pointer dereference on broken files zmbv: check av_realloc() return values and avoid memleaks on ENOMEM truespeech: align buffer ac3: Do not read past the end of ff_ac3_band_start_tab. dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936. dv: Fix null pointer dereference due to ach=0 dv: check stype ... Conflicts: doc/APIchanges libavcodec/asv1.c libavcodec/avcodec.h libavcodec/eatqi.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/zmbv.c libavformat/dv.c libswscale/swscale.c

Michael Niedermayer committed 14 years ago

Commit 4c677df2 parents 5cd8afe 5ff880219 files · +122 −115Browse files

Unified · Split

19 files
  1. doc/APIchanges +5 −0
  2. libavcodec/ac3dsp.c +5 −3
  3. libavcodec/asv1.c +2 −1
  4. libavcodec/avcodec.h +3 −28
  5. libavcodec/eatqi.c +2 −1
  6. libavcodec/frwu.c +11 −9
  7. libavcodec/golomb-test.c +44 −16
  8. libavcodec/truespeech.c +1 −1
  9. libavcodec/utils.c +4 −4
  10. libavcodec/vc1dec.c +1 −1
  11. libavcodec/zmbv.c +22 −21
  12. libavcodec/zmbvenc.c +4 −4
  13. libavformat/dv.c +1 −2
  14. libavformat/swfdec.c +1 −4
  15. libswscale/swscale.c +0 −2
  16. libswscale/x86/input.asm +13 −16
  17. libswscale/x86/swscale_mmx.c +2 −0
  18. tests/fate/libavcodec.mak +1 −0
  19. tests/ref/fate/golomb +0 −2
doc/APIchanges+5−0
@@ -16,6 +16,11 @@ API changes, most recent first: · 15 unmodified lines
1616 2012-01-24 - xxxxxxx - lavfi 2.60.100
1717 Add avfilter_graph_dump.
1818
19+2012-02-01 - xxxxxxx - lavc 54.01.0
20+ Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
21+ memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
22+ zero-padded bytes at the end.
23+
1924 2012-01-31 - xxxxxxx - lavf 54.01.0
2025 Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
2126
libavcodec/ac3dsp.c+5−3
@@ -109,7 +109,7 @@ static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd, · 108 unmodified lines
109109 int snr_offset, int floor,
110110 const uint8_t *bap_tab, uint8_t *bap)
111111 {
112− int bin, band;
112+ int bin, band, band_end;
113113
114114 /* special case, if snr offset is -960, set all bap's to zero */
115115 if (snr_offset == -960) {
@@ -121,12 +121,14 @@ static void ac3_bit_alloc_calc_bap_c(int16_t *mask, int16_t *psd, · 5 unmodified lines
121121 band = ff_ac3_bin_to_band_tab[start];
122122 do {
123123 int m = (FFMAX(mask[band] - snr_offset - floor, 0) & 0x1FE0) + floor;
124− int band_end = FFMIN(ff_ac3_band_start_tab[band+1], end);
124+ band_end = ff_ac3_band_start_tab[++band];
125+ band_end = FFMIN(band_end, end);
126+
125127 for (; bin < band_end; bin++) {
126128 int address = av_clip((psd[bin] - m) >> 5, 0, 63);
127129 bap[bin] = bap_tab[address];
128130 }
129− } while (end > ff_ac3_band_start_tab[band++]);
131+ } while (end > band_end);
130132 }
131133
132134 static void ac3_update_bap_counts_c(uint16_t mant_cnt[16], uint8_t *bap,
libavcodec/asv1.c+2−1
@@ -408,7 +408,8 @@ static int decode_frame(AVCodecContext *avctx, · 407 unmodified lines
408408 p->pict_type= AV_PICTURE_TYPE_I;
409409 p->key_frame= 1;
410410
411− av_fast_padded_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size);
411+ av_fast_padded_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size,
412+ buf_size);
412413 if (!a->bitstream_buffer)
413414 return AVERROR(ENOMEM);
414415
libavcodec/avcodec.h+3−28
@@ -185,9 +185,6 @@ enum CodecID { · 184 unmodified lines
185185 CODEC_ID_TIERTEXSEQVIDEO,
186186 CODEC_ID_TIFF,
187187 CODEC_ID_GIF,
188−#if LIBAVCODEC_VERSION_MAJOR == 53
189− CODEC_ID_FFH264,
190−#endif
191188 CODEC_ID_DXA,
192189 CODEC_ID_DNXHD,
193190 CODEC_ID_THP,
@@ -205,10 +202,6 @@ enum CodecID { · 11 unmodified lines
205202 CODEC_ID_INDEO5,
206203 CODEC_ID_MIMIC,
207204 CODEC_ID_RL2,
208−#if LIBAVCODEC_VERSION_MAJOR == 53
209− CODEC_ID_8SVX_EXP,
210− CODEC_ID_8SVX_FIB,
211−#endif
212205 CODEC_ID_ESCAPE124,
213206 CODEC_ID_DIRAC,
214207 CODEC_ID_BFI,
@@ -247,18 +240,13 @@ enum CodecID { · 32 unmodified lines
247240 CODEC_ID_DFA,
248241 CODEC_ID_WMV3IMAGE,
249242 CODEC_ID_VC1IMAGE,
250−#if LIBAVCODEC_VERSION_MAJOR == 53
251− CODEC_ID_G723_1_DEPRECATED,
252− CODEC_ID_G729_DEPRECATED,
253−#endif
254− CODEC_ID_UTVIDEO_DEPRECATED,
243+ CODEC_ID_UTVIDEO,
255244 CODEC_ID_BMV_VIDEO,
256245 CODEC_ID_VBLE,
257246 CODEC_ID_DXTORY,
258247 CODEC_ID_V410,
259248 CODEC_ID_XWD,
260249 CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
261− CODEC_ID_UTVIDEO = 0x800,
262250 CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
263251 CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
264252
@@ -397,15 +385,11 @@ enum CodecID { · 132 unmodified lines
397385 CODEC_ID_AAC_LATM,
398386 CODEC_ID_QDMC,
399387 CODEC_ID_CELT,
400−#if LIBAVCODEC_VERSION_MAJOR > 53
401− CODEC_ID_G723_1_DEPRECATED,
402− CODEC_ID_G729_DEPRECATED,
388+ CODEC_ID_G723_1,
389+ CODEC_ID_G729,
403390 CODEC_ID_8SVX_EXP,
404391 CODEC_ID_8SVX_FIB,
405−#endif
406392 CODEC_ID_BMV_AUDIO,
407− CODEC_ID_G729 = 0x15800,
408− CODEC_ID_G723_1= 0x15801,
409393 CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
410394 CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
411395 CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
@@ -1523,7 +1507,6 @@ typedef struct AVCodecContext { · 1111 unmodified lines
15231507 #define FF_BUG_DC_CLIP 4096
15241508 #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
15251509 #define FF_BUG_TRUNCATED 16384
1526−//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
15271510
15281511 /**
15291512 * luma single coefficient elimination threshold
@@ -2096,14 +2079,6 @@ typedef struct AVCodecContext { · 566 unmodified lines
20962079 * - decoding: unused
20972080 */
20982081 int context_model;
2099−#if 0
2100− /**
2101− *
2102− * - encoding: unused
2103− * - decoding: Set by user.
2104− */
2105− uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size);
2106−#endif
21072082
21082083 /**
21092084 * slice flags
libavcodec/eatqi.c+2−1
@@ -127,7 +127,8 @@ static int tqi_decode_frame(AVCodecContext *avctx, · 126 unmodified lines
127127 return -1;
128128 }
129129
130− av_fast_padded_malloc(&t->bitstream_buf, &t->bitstream_buf_size, buf_end-buf);
130+ av_fast_padded_malloc(&t->bitstream_buf, &t->bitstream_buf_size,
131+ buf_end - buf);
131132 if (!t->bitstream_buf)
132133 return AVERROR(ENOMEM);
133134 s->dsp.bswap_buf(t->bitstream_buf, (const uint32_t*)buf, (buf_end-buf)/4);
libavcodec/frwu.c+11−9
@@ -28,7 +28,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 27 unmodified lines
2828 {
2929 if (avctx->width & 1) {
3030 av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n");
31− return -1;
31+ return AVERROR(EINVAL);
3232 }
3333 avctx->pix_fmt = PIX_FMT_UYVY422;
3434
@@ -42,7 +42,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 7 unmodified lines
4242 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
4343 AVPacket *avpkt)
4444 {
45− int field;
45+ int field, ret;
4646 AVFrame *pic = avctx->coded_frame;
4747 const uint8_t *buf = avpkt->data;
4848 const uint8_t *buf_end = buf + avpkt->size;
@@ -52,16 +52,18 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 3 unmodified lines
5252
5353 if (avpkt->size < avctx->width * 2 * avctx->height + 4 + 2*8) {
5454 av_log(avctx, AV_LOG_ERROR, "Packet is too small.\n");
55− return -1;
55+ return AVERROR_INVALIDDATA;
5656 }
5757 if (bytestream_get_le32(&buf) != AV_RL32("FRW1")) {
5858 av_log(avctx, AV_LOG_ERROR, "incorrect marker\n");
59− return -1;
59+ return AVERROR_INVALIDDATA;
6060 }
6161
6262 pic->reference = 0;
63− if (avctx->get_buffer(avctx, pic) < 0)
64− return -1;
63+ if ((ret = avctx->get_buffer(avctx, pic)) < 0) {
64+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
65+ return ret;
66+ }
6567
6668 pic->pict_type = AV_PICTURE_TYPE_I;
6769 pic->key_frame = 1;
@@ -74,16 +76,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 6 unmodified lines
7476 int field_size, min_field_size = avctx->width * 2 * field_h;
7577 uint8_t *dst = pic->data[0];
7678 if (buf_end - buf < 8)
77− return -1;
79+ return AVERROR_INVALIDDATA;
7880 buf += 4; // flags? 0x80 == bottom field maybe?
7981 field_size = bytestream_get_le32(&buf);
8082 if (field_size < min_field_size) {
8183 av_log(avctx, AV_LOG_ERROR, "Field size %i is too small (required %i)\n", field_size, min_field_size);
82− return -1;
84+ return AVERROR_INVALIDDATA;
8385 }
8486 if (buf_end - buf < field_size) {
8587 av_log(avctx, AV_LOG_ERROR, "Packet is too small, need %i, have %i\n", field_size, (int)(buf_end - buf));
86− return -1;
88+ return AVERROR_INVALIDDATA;
8789 }
8890 if (field)
8991 dst += pic->linesize[0];
libavcodec/golomb-test.c+44−16
@@ -21,52 +21,80 @@ · 20 unmodified lines
2121 #include <stdint.h>
2222 #include <stdio.h>
2323
24−#include "avcodec.h"
25−#include "dsputil.h"
24+#include "libavutil/mem.h"
25+
2626 #include "get_bits.h"
2727 #include "golomb.h"
2828 #include "put_bits.h"
2929
30−#undef printf
31−#define COUNT 8000
32−#define SIZE (COUNT * 40)
30+#undef fprintf
31+#define COUNT 8191
32+#define SIZE (COUNT * 4)
3333
3434 int main(void)
3535 {
36− int i;
37− uint8_t temp[SIZE];
36+ int i, ret = 0;
37+ uint8_t *temp;
3838 PutBitContext pb;
3939 GetBitContext gb;
4040
41+ temp = av_malloc(SIZE);
42+ if (!temp)
43+ return 2;
44+
4145 init_put_bits(&pb, temp, SIZE);
42− printf("testing unsigned exp golomb\n");
4346 for (i = 0; i < COUNT; i++)
4447 set_ue_golomb(&pb, i);
4548 flush_put_bits(&pb);
4649
4750 init_get_bits(&gb, temp, 8 * SIZE);
4851 for (i = 0; i < COUNT; i++) {
49− int j, s = show_bits(&gb, 24);
52+ int j, s = show_bits(&gb, 25);
5053
5154 j = get_ue_golomb(&gb);
52− if (j != i)
53− printf("mismatch at %d (%d should be %d) bits: %6X\n", i, j, i, s);
55+ if (j != i) {
56+ fprintf(stderr, "get_ue_golomb: expected %d, got %d. bits: %7x\n",
57+ i, j, s);
58+ ret = 1;
59+ }
60+ }
61+
62+#define EXTEND(i) (i << 3 | i & 7)
63+ init_put_bits(&pb, temp, SIZE);
64+ for (i = 0; i < COUNT; i++)
65+ set_ue_golomb(&pb, EXTEND(i));
66+ flush_put_bits(&pb);
67+
68+ init_get_bits(&gb, temp, 8 * SIZE);
69+ for (i = 0; i < COUNT; i++) {
70+ int j, s = show_bits_long(&gb, 32);
71+
72+ j = get_ue_golomb_long(&gb);
73+ if (j != EXTEND(i)) {
74+ fprintf(stderr, "get_ue_golomb_long: expected %d, got %d. "
75+ "bits: %8x\n", EXTEND(i), j, s);
76+ ret = 1;
77+ }
5478 }
5579
5680 init_put_bits(&pb, temp, SIZE);
57− printf("testing signed exp golomb\n");
5881 for (i = 0; i < COUNT; i++)
5982 set_se_golomb(&pb, i - COUNT / 2);
6083 flush_put_bits(&pb);
6184
6285 init_get_bits(&gb, temp, 8 * SIZE);
6386 for (i = 0; i < COUNT; i++) {
64− int j, s = show_bits(&gb, 24);
87+ int j, s = show_bits(&gb, 25);
6588
6689 j = get_se_golomb(&gb);
67− if (j != i - COUNT / 2)
68− printf("mismatch at %d (%d should be %d) bits: %6X\n", i, j, i, s);
90+ if (j != i - COUNT / 2) {
91+ fprintf(stderr, "get_se_golomb: expected %d, got %d. bits: %7x\n",
92+ i - COUNT / 2, j, s);
93+ ret = 1;
94+ }
6995 }
7096
71− return 0;
97+ av_free(temp);
98+
99+ return ret;
72100 }
libavcodec/truespeech.c+1−1
@@ -37,7 +37,7 @@ typedef struct { · 36 unmodified lines
3737 AVFrame frame;
3838 DSPContext dsp;
3939 /* input data */
40− uint8_t buffer[32];
40+ DECLARE_ALIGNED(16, uint8_t, buffer)[32];
4141 int16_t vector[8]; ///< input vector: 5/5/4/4/4/3/3/3
4242 int offset1[2]; ///< 8-bit value, used in one copying offset
4343 int offset2[4]; ///< 7-bit value, encodes offsets for copying and for two-point filter
libavcodec/utils.c+4−4
@@ -91,7 +91,7 @@ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size) · 90 unmodified lines
9191 {
9292 uint8_t **p = ptr;
9393 if (min_size > SIZE_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
94− *p = NULL;
94+ av_freep(p);
9595 *size = 0;
9696 return;
9797 }
@@ -1448,9 +1448,9 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 1350 unmodified lines
14481448 static enum CodecID remap_deprecated_codec_id(enum CodecID id)
14491449 {
14501450 switch(id){
1451− case CODEC_ID_G723_1_DEPRECATED : return CODEC_ID_G723_1;
1452− case CODEC_ID_G729_DEPRECATED : return CODEC_ID_G729;
1453− case CODEC_ID_UTVIDEO_DEPRECATED: return CODEC_ID_UTVIDEO;
1451+ //This is for future deprecatec codec ids, its empty since
1452+ //last major bump but will fill up again over time, please dont remove it
1453+// case CODEC_ID_UTVIDEO_DEPRECATED: return CODEC_ID_UTVIDEO;
14541454 default : return id;
14551455 }
14561456 }
libavcodec/vc1dec.c+1−1
@@ -5712,7 +5712,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, · 5711 unmodified lines
57125712 if (!v->field_mode || v->second_field)
57135713 s->end_mb_y = (i == n_slices ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
57145714 else
5715− s->end_mb_y = (i == n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
5715+ s->end_mb_y = (i <= n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
57165716 vc1_decode_blocks(v);
57175717 if (i != n_slices)
57185718 s->gb = slices[i].gb;
libavcodec/zmbv.c+22−21
@@ -403,16 +403,17 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 402 unmodified lines
403403 ZmbvContext * const c = avctx->priv_data;
404404 int zret = Z_OK; // Zlib return code
405405 int len = buf_size;
406− int hi_ver, lo_ver;
406+ int hi_ver, lo_ver, ret;
407+ uint8_t *tmp;
407408
408409 if (c->pic.data[0])
409410 avctx->release_buffer(avctx, &c->pic);
410411
411412 c->pic.reference = 3;
412413 c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
413− if (avctx->get_buffer(avctx, &c->pic) < 0) {
414+ if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) {
414415 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
415− return -1;
416+ return ret;
416417 }
417418
418419 /* parse header */
@@ -434,19 +435,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 15 unmodified lines
434435 "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",
435436 c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
436437 if (hi_ver != 0 || lo_ver != 1) {
437− av_log(avctx, AV_LOG_ERROR, "Unsupported version %i.%i\n",
438− hi_ver, lo_ver);
439− return -1;
438+ av_log_ask_for_sample(avctx, "Unsupported version %i.%i\n",
439+ hi_ver, lo_ver);
440+ return AVERROR_PATCHWELCOME;
440441 }
441442 if (c->bw == 0 || c->bh == 0) {
442− av_log(avctx, AV_LOG_ERROR, "Unsupported block size %ix%i\n",
443− c->bw, c->bh);
444− return -1;
443+ av_log_ask_for_sample(avctx, "Unsupported block size %ix%i\n",
444+ c->bw, c->bh);
445+ return AVERROR_PATCHWELCOME;
445446 }
446447 if (c->comp != 0 && c->comp != 1) {
447− av_log(avctx, AV_LOG_ERROR, "Unsupported compression type %i\n",
448− c->comp);
449− return -1;
448+ av_log_ask_for_sample(avctx, "Unsupported compression type %i\n",
449+ c->comp);
450+ return AVERROR_PATCHWELCOME;
450451 }
451452
452453 switch (c->fmt) {
@@ -475,9 +476,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 22 unmodified lines
475476 break;
476477 default:
477478 c->decode_xor = NULL;
478− av_log(avctx, AV_LOG_ERROR,
479− "Unsupported (for now) format %i\n", c->fmt);
480− return -1;
479+ av_log_ask_for_sample(avctx, "Unsupported (for now) format %i\n",
480+ c->fmt);
481+ return AVERROR_PATCHWELCOME;
481482 }
482483
483484 zret = inflateReset(&c->zstream);
@@ -495,10 +496,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 11 unmodified lines
495496 c->decode_intra= decode_intra;
496497 }
497498
498− if (c->decode_intra == NULL) {
499− av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
500− return -1;
501− }
499+ if (c->decode_intra == NULL) {
500+ av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
501+ return AVERROR_INVALIDDATA;
502+ }
502503
503504 if (c->comp == 0) { //Uncompressed data
504505 memcpy(c->decomp_buf, buf, len);
@@ -628,7 +629,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 123 unmodified lines
628629 if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
629630 av_log(avctx, AV_LOG_ERROR,
630631 "Can't allocate decompression buffer.\n");
631− return 1;
632+ return AVERROR(ENOMEM);
632633 }
633634 }
634635
@@ -638,7 +639,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 3 unmodified lines
638639 zret = inflateInit(&c->zstream);
639640 if (zret != Z_OK) {
640641 av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
641− return 1;
642+ return -1;
642643 }
643644
644645 return 0;
libavcodec/zmbvenc.c+4−4
@@ -265,7 +265,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 264 unmodified lines
265265 lvl = avctx->compression_level;
266266 if(lvl < 0 || lvl > 9){
267267 av_log(avctx, AV_LOG_ERROR, "Compression level should be 0-9, not %i\n", lvl);
268− return -1;
268+ return AVERROR(EINVAL);
269269 }
270270
271271 // Needed if zlib unused or init aborted before deflateInit
@@ -274,7 +274,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 2 unmodified lines
274274 ((avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * ((avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK) * 2 + 4;
275275 if ((c->work_buf = av_malloc(c->comp_size)) == NULL) {
276276 av_log(avctx, AV_LOG_ERROR, "Can't allocate work buffer.\n");
277− return -1;
277+ return AVERROR(ENOMEM);
278278 }
279279 /* Conservative upper bound taken from zlib v1.2.1 source via lcl.c */
280280 c->comp_size = c->comp_size + ((c->comp_size + 7) >> 3) +
@@ -283,12 +283,12 @@ static av_cold int encode_init(AVCodecContext *avctx) · 2 unmodified lines
283283 /* Allocate compression buffer */
284284 if ((c->comp_buf = av_malloc(c->comp_size)) == NULL) {
285285 av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n");
286− return -1;
286+ return AVERROR(ENOMEM);
287287 }
288288 c->pstride = FFALIGN(avctx->width, 16);
289289 if ((c->prev = av_malloc(c->pstride * avctx->height)) == NULL) {
290290 av_log(avctx, AV_LOG_ERROR, "Can't allocate picture.\n");
291− return -1;
291+ return AVERROR(ENOMEM);
292292 }
293293
294294 c->zstream.zalloc = Z_NULL;
libavformat/dv.c+1−2
@@ -138,6 +138,7 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4], · 137 unmodified lines
138138 pcm = ppcm[ipcm++];
139139 if (!pcm)
140140 break;
141+
141142 /* for each DIF segment */
142143 for (i = 0; i < sys->difseg_size; i++) {
143144 frame += 6 * 80; /* skip DIF segment header */
@@ -186,8 +187,6 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4], · 42 unmodified lines
186187 frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
187188 }
188189 }
189−
190− /* next stereo channel (50Mbps and 100Mbps only) */
191190 }
192191
193192 return size;
libavformat/swfdec.c+1−4
@@ -137,10 +137,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) · 136 unmodified lines
137137 ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
138138 ast->need_parsing = AVSTREAM_PARSE_FULL;
139139 sample_rate_code= (v>>2) & 3;
140− if (!sample_rate_code)
141− ast->codec->sample_rate = 5512;
142− else
143− ast->codec->sample_rate = 11025 << (sample_rate_code-1);
140+ ast->codec->sample_rate = 44100 >> (3 - sample_rate_code);
144141 avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
145142 len -= 4;
146143 } else if (tag == TAG_VIDEOFRAME) {
libswscale/swscale.c+0−2
@@ -1736,8 +1736,6 @@ static void monoblack2Y_c(int16_t *dst, const uint8_t *src, const uint8_t *unuse · 1735 unmodified lines
17361736 }
17371737 }
17381738
1739−//FIXME yuy2* can read up to 7 samples too much
1740−
17411739 static void yuy2ToY_c(uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width,
17421740 uint32_t *unused)
17431741 {
libswscale/x86/input.asm+13−16
@@ -271,31 +271,28 @@ cglobal %2 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, u3 · 270 unmodified lines
271271 %endif ; ARCH_X86_64 && %0 == 3
272272 %endmacro
273273
274+; %1 = nr. of XMM registers for rgb-to-Y func
275+; %2 = nr. of XMM registers for rgb-to-UV func
276+%macro RGB24_FUNCS 2
277+RGB24_TO_Y_FN %1, rgb
278+RGB24_TO_Y_FN %1, bgr, rgb
279+RGB24_TO_UV_FN %2, rgb
280+RGB24_TO_UV_FN %2, bgr, rgb
281+%endmacro
282+
274283 %if ARCH_X86_32
275284 INIT_MMX mmx
276−RGB24_TO_Y_FN 0, rgb
277−RGB24_TO_Y_FN 0, bgr, rgb
278−RGB24_TO_UV_FN 0, rgb
279−RGB24_TO_UV_FN 0, bgr, rgb
285+RGB24_FUNCS 0, 0
280286 %endif
281287
282288 INIT_XMM sse2
283−RGB24_TO_Y_FN 10, rgb
284−RGB24_TO_Y_FN 10, bgr, rgb
285−RGB24_TO_UV_FN 12, rgb
286−RGB24_TO_UV_FN 12, bgr, rgb
289+RGB24_FUNCS 10, 12
287290
288291 INIT_XMM ssse3
289−RGB24_TO_Y_FN 11, rgb
290−RGB24_TO_Y_FN 11, bgr, rgb
291−RGB24_TO_UV_FN 13, rgb
292−RGB24_TO_UV_FN 13, bgr, rgb
292+RGB24_FUNCS 11, 13
293293
294294 INIT_XMM avx
295−RGB24_TO_Y_FN 11, rgb
296−RGB24_TO_Y_FN 11, bgr, rgb
297−RGB24_TO_UV_FN 13, rgb
298−RGB24_TO_UV_FN 13, bgr, rgb
295+RGB24_FUNCS 11, 13
299296
300297 ;-----------------------------------------------------------------------------
301298 ; YUYV/UYVY/NV12/NV21 packed pixel shuffling.
libswscale/x86/swscale_mmx.c+2−0
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 #include "libavutil/cpu.h"
2828 #include "libavutil/pixdesc.h"
2929
30+#define DITHER1XBPP
31+
3032 DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL;
3133 DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL;
3234 DECLARE_ASM_CONST(8, uint64_t, w10)= 0x0010001000100010LL;
tests/fate/libavcodec.mak+1−0
@@ -1,6 +1,7 @@
11 FATE_TESTS += fate-golomb
22 fate-golomb: libavcodec/golomb-test$(EXESUF)
33 fate-golomb: CMD = run libavcodec/golomb-test
4+fate-golomb: REF = /dev/null
45
56 FATE_TESTS += fate-iirfilter
67 fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
tests/ref/fate/golomb+0−2
@@ -1,2 +0,0 @@
1−testing unsigned exp golomb
2−testing signed exp golomb

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t