Commit 2ec77aae authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavf: make compute_pkt_fields2() return meaningful error values
  matroskadec: set timestamps for RealAudio packets.
  intelh263dec: aspect ratio processing fix.
  intelh263dec: fix "Strict H.263 compliance"  file playback
  oss,sndio: simplify by using FFMIN.
  swscale: extract monowhite/black output from yuv2packed[12X]_c().
  swscale: de-macro'ify RGB15/16/32 input functions.
  swscale: rearrange code.
  movdec: Add support for the 'wfex' atom.
  ffmpeg.c: Add a necessary const qualifier
  riff: Fix potential memleak.
  swscale: change 48bit RGB input macros to inline functions.
  swscale: change 9/10bit YUV input macros to inline functions.
  swscale: extract gray16 output functions from yuv2packed[12X]().
  swscale: use standard clipping functions.
  swscale: merge macros that are used only once.
  swscale: fix function declarations in swscale.c.
  swscale: fix function declaration keywords in x86/swscale_template.c.

Conflicts:
	ffmpeg.c
	libavcodec/intelh263dec.c
	libswscale/swscale.c
	libswscale/x86/swscale_template.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 6a137dde 996bbdbf
...@@ -67,9 +67,9 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) ...@@ -67,9 +67,9 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
if (format < 6) { if (format < 6) {
s->width = h263_format[format][0]; s->width = h263_format[format][0];
s->height = h263_format[format][1]; s->height = h263_format[format][1];
s->avctx->sample_aspect_ratio.num=12;s->avctx->sample_aspect_ratio.den=11; s->avctx->sample_aspect_ratio.num = 12;
} s->avctx->sample_aspect_ratio.den = 11;
else { } else {
format = get_bits(&s->gb, 3); format = get_bits(&s->gb, 3);
if(format == 0 || format == 7){ if(format == 0 || format == 7){
av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n"); av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n");
...@@ -95,12 +95,11 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) ...@@ -95,12 +95,11 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
if(ar == 15){ if(ar == 15){
s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 8); // aspect ratio - width s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 8); // aspect ratio - width
s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 8); // aspect ratio - height s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 8); // aspect ratio - height
} } else {
else {
s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[ar]; s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[ar];
} }
if(s->avctx->sample_aspect_ratio.num == 0) if (s->avctx->sample_aspect_ratio.num == 0)
av_log(s->avctx, AV_LOG_ERROR, "Invalid aspect ratio\n"); av_log(s->avctx, AV_LOG_ERROR, "Invalid aspect ratio.\n");
} }
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
......
...@@ -513,6 +513,19 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -513,6 +513,19 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0; return 0;
} }
static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
ff_get_wav_header(pb, st->codec, atom.size);
return 0;
}
static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{ {
const int num = avio_rb32(pb); const int num = avio_rb32(pb);
...@@ -2261,6 +2274,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { ...@@ -2261,6 +2274,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('e','s','d','s'), mov_read_esds }, { MKTAG('e','s','d','s'), mov_read_esds },
{ MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */ { MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
{ MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */ { MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
{ MKTAG('w','f','e','x'), mov_read_wfex },
{ MKTAG('c','m','o','v'), mov_read_cmov }, { MKTAG('c','m','o','v'), mov_read_cmov },
{ MKTAG('c','h','a','n'), mov_read_chan }, { MKTAG('c','h','a','n'), mov_read_chan },
{ 0, NULL } { 0, NULL }
......
...@@ -537,6 +537,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) ...@@ -537,6 +537,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
} }
codec->extradata_size = cbSize; codec->extradata_size = cbSize;
if (cbSize > 0) { if (cbSize > 0) {
av_free(codec->extradata);
codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata) if (!codec->extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
This diff is collapsed.
...@@ -77,13 +77,17 @@ const char *swscale_license(void) ...@@ -77,13 +77,17 @@ const char *swscale_license(void)
|| (x)==PIX_FMT_BGR48BE \ || (x)==PIX_FMT_BGR48BE \
|| (x)==PIX_FMT_BGR48LE \ || (x)==PIX_FMT_BGR48LE \
|| (x)==PIX_FMT_BGR24 \ || (x)==PIX_FMT_BGR24 \
|| (x)==PIX_FMT_BGR565 \ || (x)==PIX_FMT_BGR565LE \
|| (x)==PIX_FMT_BGR555 \ || (x)==PIX_FMT_BGR565BE \
|| (x)==PIX_FMT_BGR555LE \
|| (x)==PIX_FMT_BGR555BE \
|| (x)==PIX_FMT_BGR32 \ || (x)==PIX_FMT_BGR32 \
|| (x)==PIX_FMT_BGR32_1 \ || (x)==PIX_FMT_BGR32_1 \
|| (x)==PIX_FMT_RGB24 \ || (x)==PIX_FMT_RGB24 \
|| (x)==PIX_FMT_RGB565 \ || (x)==PIX_FMT_RGB565LE \
|| (x)==PIX_FMT_RGB555 \ || (x)==PIX_FMT_RGB565BE \
|| (x)==PIX_FMT_RGB555LE \
|| (x)==PIX_FMT_RGB555BE \
|| (x)==PIX_FMT_GRAY8 \ || (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_GRAY8A \ || (x)==PIX_FMT_GRAY8A \
|| (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_YUV410P \
...@@ -137,7 +141,22 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt) ...@@ -137,7 +141,22 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt)
|| (x)==PIX_FMT_YUVJ422P \ || (x)==PIX_FMT_YUVJ422P \
|| (x)==PIX_FMT_YUVJ440P \ || (x)==PIX_FMT_YUVJ440P \
|| (x)==PIX_FMT_YUVJ444P \ || (x)==PIX_FMT_YUVJ444P \
|| isAnyRGB(x) \ || isRGBinBytes(x) \
|| isBGRinBytes(x) \
|| (x)==PIX_FMT_RGB565 \
|| (x)==PIX_FMT_RGB555 \
|| (x)==PIX_FMT_RGB444 \
|| (x)==PIX_FMT_BGR565 \
|| (x)==PIX_FMT_BGR555 \
|| (x)==PIX_FMT_BGR444 \
|| (x)==PIX_FMT_RGB8 \
|| (x)==PIX_FMT_BGR8 \
|| (x)==PIX_FMT_RGB4_BYTE \
|| (x)==PIX_FMT_BGR4_BYTE \
|| (x)==PIX_FMT_RGB4 \
|| (x)==PIX_FMT_BGR4 \
|| (x)==PIX_FMT_MONOBLACK \
|| (x)==PIX_FMT_MONOWHITE \
|| (x)==PIX_FMT_NV12 \ || (x)==PIX_FMT_NV12 \
|| (x)==PIX_FMT_NV21 \ || (x)==PIX_FMT_NV21 \
|| (x)==PIX_FMT_GRAY16BE \ || (x)==PIX_FMT_GRAY16BE \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment