From: Michael Niedermayer Date: Wed, 9 Jan 2013 11:30:14 +0000 (+0100) Subject: Merge remote-tracking branch 'qatar/master' X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4765f635387cef3efb01e52e59d4f3add126a0e2;p=ffmpeg Merge remote-tracking branch 'qatar/master' * qatar/master: xan: Convert to bytestream2 oggenc: add a page_duration option and deprecate the pagesize option x86: lavr: add SSE2/AVX dither_int_to_float() Conflicts: libavcodec/xan.c libavformat/oggenc.c Merged-by: Michael Niedermayer --- 4765f635387cef3efb01e52e59d4f3add126a0e2 diff --cc libavcodec/xan.c index 3a559e929ba,a1671e1cc59..219eedd92dc --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@@ -526,13 -511,9 +530,13 @@@ static int xan_decode_frame(AVCodecCont uint32_t new_pal; int size; int i; - tag = bytestream_get_le32(&buf); - size = bytestream_get_be32(&buf); + tag = bytestream2_get_le32(&ctx); + size = bytestream2_get_be32(&ctx); + if(size < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid tag size %d\n", size); + return AVERROR_INVALIDDATA; + } - size = FFMIN(size, buf_end - buf); + size = FFMIN(size, bytestream2_get_bytes_left(&ctx)); switch (tag) { case PALT_TAG: if (size < PALETTE_SIZE) @@@ -547,15 -528,15 +551,15 @@@ tmpptr += s->palettes_count * AVPALETTE_COUNT; for (i = 0; i < PALETTE_COUNT; i++) { #if RUNTIME_GAMMA - int r = gamma_corr(*buf++); - int g = gamma_corr(*buf++); - int b = gamma_corr(*buf++); + int r = gamma_corr(bytestream2_get_byteu(&ctx)); + int g = gamma_corr(bytestream2_get_byteu(&ctx)); + int b = gamma_corr(bytestream2_get_byteu(&ctx)); #else - int r = gamma_lookup[*buf++]; - int g = gamma_lookup[*buf++]; - int b = gamma_lookup[*buf++]; + int r = gamma_lookup[bytestream2_get_byteu(&ctx)]; + int g = gamma_lookup[bytestream2_get_byteu(&ctx)]; + int b = gamma_lookup[bytestream2_get_byteu(&ctx)]; #endif - *tmpptr++ = (r << 16) | (g << 8) | b; + *tmpptr++ = (0xFFU << 24) | (r << 16) | (g << 8) | b; } s->palettes_count++; break; diff --cc libavformat/oggenc.c index 2ff6704698b,6212d16373b..31e28413e91 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@@ -74,10 -75,10 +76,12 @@@ typedef struct #define PARAM AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { + { "oggpagesize", "Set preferred Ogg page size.", + offsetof(OGGContext, pref_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_PAGE_SIZE, AV_OPT_FLAG_ENCODING_PARAM}, - { "pagesize", "preferred page size in bytes", + { "pagesize", "preferred page size in bytes (deprecated)", OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM }, + { "page_duration", "preferred page duration, in microseconds", + OFFSET(pref_duration), AV_OPT_TYPE_INT, { .i64 = 1000000 }, 0, INT64_MAX, PARAM }, { NULL }, };