Skip to content

Commit

Permalink
FFmpeg resync to FFmpeg release/1.1 at SHA1 fc7071cb53ded2e332947ce21…
Browse files Browse the repository at this point in the history
…45b587c5bdcd075

Conflict in libavcodec/mpegaudio_parser.c
  • Loading branch information
jyavenard committed Mar 30, 2013
1 parent cc2f9dd commit 0770c5d
Show file tree
Hide file tree
Showing 37 changed files with 303 additions and 190 deletions.
3 changes: 2 additions & 1 deletion mythtv/external/FFmpeg/MAINTAINERS
Expand Up @@ -445,10 +445,11 @@ x86 Michael Niedermayer
Releases
========

1.2 Michael Niedermayer
1.1 Michael Niedermayer
1.0 Michael Niedermayer
0.11 Michael Niedermayer

If you want to maintain an older release, please contact us


GnuPG Fingerprints of maintainers and contributors
Expand Down
1 change: 1 addition & 0 deletions mythtv/external/FFmpeg/README.sync
Expand Up @@ -8,6 +8,7 @@ git://source.ffmpeg.org/ffmpeg.git at SHA1 59d765e3 on December 12th, 2012 (jya)
git://source.ffmpeg.org/ffmpeg.git at SHA1 553c9c77 on December 16th, 2012 (jya) (release/1.0 branch)
git://source.ffmpeg.org/ffmpeg.git at SHA1 057051b8 on February 17th, 2013 (jya) (release/1.1 branch)
git://source.ffmpeg.org/ffmpeg.git at SHA1 7c8beec4 on March 7th, 2013 (jya) (release/1.1 branch)
git://source.ffmpeg.org/ffmpeg.git at SHA1 fc7071cb on March 30th, 2013 (jya) (release/1.1 branch)

List of files modified from original FFmpeg:
Makefile
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/RELEASE
@@ -1 +1 @@
1.1.3
1.1.4
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/VERSION
@@ -1 +1 @@
1.1.3
1.1.4
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/doc/Doxyfile
Expand Up @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 1.1.3
PROJECT_NUMBER = 1.1.4

# With the PROJECT_LOGO tag one can specify an logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down
22 changes: 19 additions & 3 deletions mythtv/external/FFmpeg/libavcodec/aacsbr.c
Expand Up @@ -1121,7 +1121,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
float fac = temp1 / (1.0f + temp2);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
sbr->data[0].env_facs[e][k] = fac;
sbr->data[1].env_facs[e][k] = fac * temp2;
}
Expand All @@ -1130,7 +1135,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (k = 0; k < sbr->n_q; k++) {
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
float fac = temp1 / (1.0f + temp2);
float fac;
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
sbr->data[0].noise_facs[e][k] = fac;
sbr->data[1].noise_facs[e][k] = fac * temp2;
}
Expand All @@ -1139,9 +1149,15 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
sbr->data[ch].env_facs[e][k] =
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
if (sbr->data[ch].env_facs[e][k] > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
sbr->data[ch].env_facs[e][k] = 1;
}
}

for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
for (k = 0; k < sbr->n_q; k++)
sbr->data[ch].noise_facs[e][k] =
Expand Down
5 changes: 4 additions & 1 deletion mythtv/external/FFmpeg/libavcodec/atrac3.c
Expand Up @@ -165,7 +165,10 @@ static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)

off = (intptr_t)input & 3;
buf = (const uint32_t *)(input - off);
c = av_be2ne32((0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8))));
if (off)
c = av_be2ne32((0x537F6103U >> (off * 8)) | (0x537F6103U << (32 - (off * 8))));
else
c = av_be2ne32(0x537F6103U);
bytes += 3 + off;
for (i = 0; i < bytes / 4; i++)
output[i] = c ^ buf[i];
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavcodec/dnxhddec.c
Expand Up @@ -406,7 +406,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,

*picture = ctx->picture;
*got_frame = 1;
return buf_size;
return avpkt->size;
}

static av_cold int dnxhd_decode_close(AVCodecContext *avctx)
Expand Down
1 change: 1 addition & 0 deletions mythtv/external/FFmpeg/libavcodec/dpxenc.c
Expand Up @@ -212,6 +212,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf[803] = s->bits_per_component;
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
1 : 0); /* packing method */
write32(buf + 808, HEADER_SIZE); /* data offset */

/* Image source information header */
write32(buf + 1628, avctx->sample_aspect_ratio.num);
Expand Down
15 changes: 15 additions & 0 deletions mythtv/external/FFmpeg/libavcodec/eamad.c
Expand Up @@ -276,6 +276,21 @@ static int decode_frame(AVCodecContext *avctx,
}
}

if (inter && !s->last_frame.data[0]) {
int ret;
av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
s->last_frame.reference = 1;
ret = ff_get_buffer(avctx, &s->last_frame);
if (ret < 0)
return ret;
memset(s->last_frame.data[0], 0, s->last_frame.height *
s->last_frame.linesize[0]);
memset(s->last_frame.data[1], 0x80, s->last_frame.height / 2 *
s->last_frame.linesize[1]);
memset(s->last_frame.data[2], 0x80, s->last_frame.height / 2 *
s->last_frame.linesize[2]);
}

av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf);
if (!s->bitstream_buf)
Expand Down
6 changes: 6 additions & 0 deletions mythtv/external/FFmpeg/libavcodec/h264.c
Expand Up @@ -2443,6 +2443,12 @@ static int h264_set_parameter_from_sps(H264Context *h)
if (s->avctx->has_b_frames < 2)
s->avctx->has_b_frames = !s->low_delay;

if (h->sps.bit_depth_luma != h->sps.bit_depth_chroma) {
av_log_missing_feature(s->avctx,
"Different bit depth between chroma and luma", 1);
return AVERROR_PATCHWELCOME;
}

if (s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
h->cur_chroma_format_idc != h->sps.chroma_format_idc) {
if (s->avctx->codec &&
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavcodec/libmp3lame.c
Expand Up @@ -218,7 +218,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
} else {
lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
BUFFER_SIZE - s->buffer_index);
s->buffer_size - s->buffer_index);
}
if (lame_result < 0) {
if (lame_result == -1) {
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavcodec/libx264.c
Expand Up @@ -174,7 +174,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
X264_TYPE_AUTO;
if (x4->params.b_tff != frame->top_field_first) {
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
x4->params.b_tff = frame->top_field_first;
x264_encoder_reconfig(x4->enc, &x4->params);
}
Expand Down
5 changes: 4 additions & 1 deletion mythtv/external/FFmpeg/libavcodec/mjpegdec.c
Expand Up @@ -740,7 +740,9 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)

i = 8 + ((-get_bits_count(&s->gb)) & 7);
/* skip RSTn */
if (s->restart_count == 0 && show_bits(&s->gb, i) == (1 << i) - 1) {
if (s->restart_count == 0) {
if( show_bits(&s->gb, i) == (1 << i) - 1
|| show_bits(&s->gb, i) == 0xFF) {
int pos = get_bits_count(&s->gb);
align_get_bits(&s->gb);
while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
Expand All @@ -750,6 +752,7 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
s->last_dc[i] = 1024;
} else
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions mythtv/external/FFmpeg/libavcodec/mpegaudio_parser.c
Expand Up @@ -30,6 +30,7 @@ typedef struct MpegAudioParseContext {
int frame_size;
uint32_t header;
int header_count;
int no_bitrate;
} MpegAudioParseContext;

#define MPA_HEADER_SIZE 4
Expand Down Expand Up @@ -77,11 +78,14 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
s->header_count++;
s->frame_size = ret-4;

if (s->header_count > 1 || avctx->sample_rate == 0) {
if (s->header_count > 0 || avctx->sample_rate == 0) {
avctx->sample_rate= sr;
avctx->channels = channels;
s1->duration = frame_size;
avctx->bit_rate = bit_rate;
if (s->no_bitrate || !avctx->bit_rate) {
s->no_bitrate = 1;
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
}
}
break;
}
Expand Down
67 changes: 36 additions & 31 deletions mythtv/external/FFmpeg/libavcodec/msrledec.c
Expand Up @@ -138,7 +138,8 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3);

output = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
output_end = pic->data[0] + avctx->height * pic->linesize[0];
output_end = output + FFABS(pic->linesize[0]);

while (bytestream2_get_bytes_left(gb) > 0) {
p1 = bytestream2_get_byteu(gb);
if(p1 == 0) { //Escape code
Expand All @@ -155,6 +156,7 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
}
}
output = pic->data[0] + line * pic->linesize[0];
output_end = output + FFABS(pic->linesize[0]);
pos = 0;
continue;
} else if(p2 == 1) { //End-of-picture
Expand All @@ -169,11 +171,11 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
return -1;
}
output = pic->data[0] + line * pic->linesize[0] + pos * (depth >> 3);
output_end = pic->data[0] + line * pic->linesize[0] + FFABS(pic->linesize[0]);
continue;
}
// Copy data
if ((pic->linesize[0] > 0 && output + p2 * (depth >> 3) > output_end) ||
(pic->linesize[0] < 0 && output + p2 * (depth >> 3) < output_end)) {
if (output + p2 * (depth >> 3) > output_end) {
bytestream2_skip(gb, 2 * (depth >> 3));
continue;
} else if (bytestream2_get_bytes_left(gb) < p2 * (depth >> 3)) {
Expand Down Expand Up @@ -203,36 +205,39 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
pos += p2;
} else { //run of pixels
uint8_t pix[3]; //original pixel
switch(depth){
case 8: pix[0] = bytestream2_get_byte(gb);
break;
case 16: pix16 = bytestream2_get_le16(gb);
break;
case 24: pix[0] = bytestream2_get_byte(gb);
pix[1] = bytestream2_get_byte(gb);
pix[2] = bytestream2_get_byte(gb);
break;
case 32: pix32 = bytestream2_get_le32(gb);
break;
}
if ((pic->linesize[0] > 0 && output + p1 * (depth >> 3) > output_end) ||
(pic->linesize[0] < 0 && output + p1 * (depth >> 3) < output_end))
if (output + p1 * (depth >> 3) > output_end)
continue;
for(i = 0; i < p1; i++) {
switch(depth){
case 8: *output++ = pix[0];
break;
case 16: *(uint16_t*)output = pix16;
output += 2;
break;
case 24: *output++ = pix[0];
*output++ = pix[1];
*output++ = pix[2];
break;
case 32: *(uint32_t*)output = pix32;
output += 4;
break;

switch(depth){
case 8:
pix[0] = bytestream2_get_byte(gb);
for(i = 0; i < p1; i++)
*output++ = pix[0];
break;
case 16:
pix16 = bytestream2_get_le16(gb);
for(i = 0; i < p1; i++) {
*(uint16_t*)output = pix16;
output += 2;
}
break;
case 24:
pix[0] = bytestream2_get_byte(gb);
pix[1] = bytestream2_get_byte(gb);
pix[2] = bytestream2_get_byte(gb);
for(i = 0; i < p1; i++) {
*output++ = pix[0];
*output++ = pix[1];
*output++ = pix[2];
}
break;
case 32:
pix32 = bytestream2_get_le32(gb);
for(i = 0; i < p1; i++) {
*(uint32_t*)output = pix32;
output += 4;
}
break;
}
pos += p1;
}
Expand Down
4 changes: 1 addition & 3 deletions mythtv/external/FFmpeg/libavcodec/png.c
Expand Up @@ -38,9 +38,7 @@ static const uint8_t ff_png_pass_xshift[NB_PASSES] = {

void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size)
{
if(items >= UINT_MAX / size)
return NULL;
return av_malloc(items * size);
return av_mallocz_array(items, size);
}

void ff_png_zfree(void *opaque, void *ptr)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavcodec/psymodel.c
Expand Up @@ -106,7 +106,7 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av
if (!cutoff_coeff && avctx->codec_id == AV_CODEC_ID_AAC)
cutoff_coeff = 2.0 * AAC_CUTOFF(avctx) / avctx->sample_rate;

if (cutoff_coeff)
if (cutoff_coeff && cutoff_coeff < 0.98)
ctx->fcoeffs = ff_iir_filter_init_coeffs(avctx, FF_FILTER_TYPE_BUTTERWORTH,
FF_FILTER_MODE_LOWPASS, FILT_ORDER,
cutoff_coeff, 0.0, 0.0);
Expand Down

0 comments on commit 0770c5d

Please sign in to comment.