[FFmpeg-cvslog] Merge commit 'e48d1ea541be4592ebac89875557407ca958b7a9'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
11:20:13 2014 +0200| [35469835bb2960f85b6c4acf1963207937e7] | committer: 
Michael Niedermayer

Merge commit 'e48d1ea541be4592ebac89875557407ca958b7a9'

* commit 'e48d1ea541be4592ebac89875557407ca958b7a9':
  ismindex: improve diagnostics

Conflicts:
tools/ismindex.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35469835bb2960f85b6c4acf1963207937e7
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ismindex: improve diagnostics

2014-09-02 Thread Mika Raento
ffmpeg | branch: master | Mika Raento  | Mon Sep  1 
16:16:49 2014 +0300| [e48d1ea541be4592ebac89875557407ca958b7a9] | committer: 
Martin Storsjö

ismindex: improve diagnostics

This improves error messages for completely and somewhat broken inputs.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e48d1ea541be4592ebac89875557407ca958b7a9
---

 tools/ismindex.c |   57 --
 1 file changed, 43 insertions(+), 14 deletions(-)

diff --git a/tools/ismindex.c b/tools/ismindex.c
index a2eed87..f49916a 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -96,14 +96,22 @@ static int copy_tag(AVIOContext *in, AVIOContext *out, 
int32_t tag_name)
 tag  = avio_rb32(in);
 avio_wb32(out, size);
 avio_wb32(out, tag);
-if (tag != tag_name)
+if (tag != tag_name) {
+char tag_str[4], tag_name_str[4];
+AV_WB32(tag_str, tag);
+AV_WB32(tag_name_str, tag_name);
+fprintf(stderr, "wanted tag %.4s, got %.4s\n", tag_name_str, tag_str);
 return -1;
+}
 size -= 8;
 while (size > 0) {
 char buf[1024];
 int len = FFMIN(sizeof(buf), size);
-if (avio_read(in, buf, len) != len)
+int got;
+if ((got = avio_read(in, buf, len)) != len) {
+fprintf(stderr, "short read, wanted %d, got %d\n", len, got);
 break;
+}
 avio_write(out, buf, len);
 size -= len;
 }
@@ -115,10 +123,15 @@ static int write_fragment(const char *filename, 
AVIOContext *in)
 AVIOContext *out = NULL;
 int ret;
 
-if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0)
+if ((ret = avio_open2(&out, filename, AVIO_FLAG_WRITE, NULL, NULL)) < 0) {
+char errbuf[100];
+av_strerror(ret, errbuf, sizeof(errbuf));
+fprintf(stderr, "Unable to open %s: %s\n", filename, errbuf);
 return ret;
-copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
-copy_tag(in, out, MKBETAG('m', 'd', 'a', 't'));
+}
+ret = copy_tag(in, out, MKBETAG('m', 'o', 'o', 'f'));
+if (!ret)
+ret = copy_tag(in, out, MKBETAG('m', 'd', 'a', 't'));
 
 avio_flush(out);
 avio_close(out);
@@ -207,6 +220,7 @@ static int read_mfra(struct Tracks *tracks, int start_index,
  const char *file, int split, const char *output_prefix)
 {
 int err = 0;
+const char* err_str = "";
 AVIOContext *f = NULL;
 int32_t mfra_size;
 
@@ -217,10 +231,12 @@ static int read_mfra(struct Tracks *tracks, int 
start_index,
 avio_seek(f, -mfra_size, SEEK_CUR);
 if (avio_rb32(f) != mfra_size) {
 err = AVERROR_INVALIDDATA;
+err_str = "mfra size mismatch";
 goto fail;
 }
 if (avio_rb32(f) != MKBETAG('m', 'f', 'r', 'a')) {
 err = AVERROR_INVALIDDATA;
+err_str = "mfra tag mismatch";
 goto fail;
 }
 while (!read_tfra(tracks, start_index, f)) {
@@ -234,7 +250,7 @@ fail:
 if (f)
 avio_close(f);
 if (err)
-fprintf(stderr, "Unable to read the MFRA atom in %s\n", file);
+fprintf(stderr, "Unable to read the MFRA atom in %s (%s)\n", file, 
err_str);
 return err;
 }
 
@@ -252,12 +268,14 @@ static int get_video_private_data(struct Track *track, 
AVCodecContext *codec)
 {
 AVIOContext *io = NULL;
 uint16_t sps_size, pps_size;
-int err = AVERROR(EINVAL);
+int err;
 
 if (codec->codec_id == AV_CODEC_ID_VC1)
 return get_private_data(track, codec);
 
-avio_open_dyn_buf(&io);
+if ((err = avio_open_dyn_buf(&io)) < 0)
+goto fail;
+err = AVERROR(EINVAL);
 if (codec->extradata_size < 11 || codec->extradata[0] != 1)
 goto fail;
 sps_size = AV_RB16(&codec->extradata[6]);
@@ -431,12 +449,23 @@ static void print_track_chunks(FILE *out, struct Tracks 
*tracks, int main,
 {
 int i, j;
 struct Track *track = tracks->tracks[main];
+int should_print_time_mismatch = 1;
+
 for (i = 0; i < track->chunks; i++) {
 for (j = main + 1; j < tracks->nb_tracks; j++) {
-if (tracks->tracks[j]->is_audio == track->is_audio &&
-track->offsets[i].duration != 
tracks->tracks[j]->offsets[i].duration)
-fprintf(stderr, "Mismatched duration of %s chunk %d in %s and 
%s\n",
-type, i, track->name, tracks->tracks[j]->name);
+if (tracks->tracks[j]->is_audio == track->is_audio) {
+if (track->offsets[i].duration != 
tracks->tracks[j]->offsets[i].duration) {
+fprintf(stderr, "Mismatched duration of %s chunk %d in %s 
(%d) and %s (%d)\n",
+type, i, track->name, main, 
tracks->tracks[j]->name, j);
+should_print_time_mismatch = 1;
+}
+if (track->offsets[i].time != 
tracks->tracks[j]->offsets[i].time) {
+if (should_print_time_mismatch

[FFmpeg-cvslog] segment: don't access outside seg->frames array

2014-09-02 Thread Mika Raento
ffmpeg | branch: master | Mika Raento  | Mon Sep  1 
20:10:03 2014 +0300| [58e0402e02ae5e466c33b9465c1465fdee68d342] | committer: 
Michael Niedermayer

segment: don't access outside seg->frames array

Fixes wrong number of segments output and undefined memory access.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58e0402e02ae5e466c33b9465c1465fdee68d342
---

 libavformat/segment.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index ce784da..1cb6454 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -684,7 +684,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 end_pts = seg->segment_count < seg->nb_times ?
 seg->times[seg->segment_count] : INT64_MAX;
 } else if (seg->frames) {
-start_frame = seg->segment_count <= seg->nb_frames ?
+start_frame = seg->segment_count < seg->nb_frames ?
 seg->frames[seg->segment_count] : INT_MAX;
 } else {
 if (seg->use_clocktime) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Support decoding of ImageJ png in avi.

2014-09-02 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Tue Sep  2 
12:02:03 2014 +0200| [3668168afa1ef73928b2c6cc2a6ffa8e8ad82312] | committer: 
Carl Eugen Hoyos

Support decoding of ImageJ png in avi.

Fixes ticket #3916.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3668168afa1ef73928b2c6cc2a6ffa8e8ad82312
---

 libavformat/riff.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 735dea0..053038b 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -321,6 +321,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
 { AV_CODEC_ID_TARGA,MKTAG('t', 'g', 'a', ' ') },
 { AV_CODEC_ID_PNG,  MKTAG('M', 'P', 'N', 'G') },
 { AV_CODEC_ID_PNG,  MKTAG('P', 'N', 'G', '1') },
+{ AV_CODEC_ID_PNG,  MKTAG('p', 'n', 'g', ' ') }, /* ImageJ */
 { AV_CODEC_ID_CLJR, MKTAG('C', 'L', 'J', 'R') },
 { AV_CODEC_ID_DIRAC,MKTAG('d', 'r', 'a', 'c') },
 { AV_CODEC_ID_RPZA, MKTAG('a', 'z', 'p', 'r') },

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] segment: fix copying stream metadata

2014-09-02 Thread Mika Raento
ffmpeg | branch: master | Mika Raento  | Mon Sep  1 
20:05:44 2014 +0300| [502fc3b3d4b36015562d19d74f27d0a4ff835c4e] | committer: 
Michael Niedermayer

segment: fix copying stream metadata

To get mpegts metadata copied when segmenting.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=502fc3b3d4b36015562d19d74f27d0a4ff835c4e
---

 libavformat/segment.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 98301dd..3ee7d7d 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -160,6 +160,7 @@ static int segment_mux_init(AVFormatContext *s)
 ocodec->codec_tag = 0;
 }
 st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+av_dict_copy(&st->metadata, s->streams[i]->metadata, 0);
 }
 
 return 0;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] segment: use mpegts_flags instead of the deprecated resend_headers option

2014-09-02 Thread Mika Raento
ffmpeg | branch: master | Mika Raento  | Mon Sep  1 
20:05:44 2014 +0300| [413fa76f61f2d4a07dd52e5e70385aa99b42] | committer: 
Michael Niedermayer

segment: use mpegts_flags instead of the deprecated resend_headers option

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=413fa76f61f2d4a07dd52e5e70385aa99b42
---

 libavformat/segment.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 7919a39..98301dd 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -222,7 +222,7 @@ static int segment_start(AVFormatContext *s, int 
write_header)
 }
 
 if (oc->oformat->priv_class && oc->priv_data)
-av_opt_set(oc->priv_data, "resend_headers", "1", 0); /* mpegts 
specific */
+av_opt_set(oc->priv_data, "mpegts_flags", "+resend_headers", 0);
 
 if (write_header) {
 if ((err = avformat_write_header(oc, NULL)) < 0)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/segment: Use avformat_alloc_output_context2()

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
12:19:53 2014 +0200| [0ffe32cf8f922a3538751c68b92840321594950f] | committer: 
Michael Niedermayer

avformat/segment: Use avformat_alloc_output_context2()

This avoids having to assign oformat, allows returning the
correct error code and allocates priv_data

Based on patch by: Mika Raento 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ffe32cf8f922a3538751c68b92840321594950f
---

 libavformat/segment.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 1cb6454..7919a39 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -133,12 +133,13 @@ static int segment_mux_init(AVFormatContext *s)
 SegmentContext *seg = s->priv_data;
 AVFormatContext *oc;
 int i;
+int ret;
 
-seg->avf = oc = avformat_alloc_context();
-if (!oc)
-return AVERROR(ENOMEM);
+ret = avformat_alloc_output_context2(&seg->avf, seg->oformat, NULL, NULL);
+if (ret < 0)
+return ret;
+oc = seg->avf;
 
-oc->oformat= seg->oformat;
 oc->interrupt_callback = s->interrupt_callback;
 av_dict_copy(&oc->metadata, s->metadata, 0);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/rawdec: Support CODEC_CAP_PARAM_CHANGE

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
05:15:30 2014 +0200| [1587989518cd61bae3d1b234efd82cd3b11580dd] | committer: 
Michael Niedermayer

avcodec/rawdec: Support CODEC_CAP_PARAM_CHANGE

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1587989518cd61bae3d1b234efd82cd3b11580dd
---

 libavcodec/rawdec.c |   30 --
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 305c13e..28792a1 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -98,19 +98,6 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 memset(context->palette->data, 0, AVPALETTE_SIZE);
 }
 
-if ((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 
2) &&
-avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
-   (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))) {
-context->is_2_4_bpp = 1;
-context->frame_size = avpicture_get_size(avctx->pix_fmt,
- FFALIGN(avctx->width, 16),
- avctx->height);
-} else {
-context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && 
avctx->bits_per_coded_sample && avctx->bits_per_coded_sample < 16;
-context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
- avctx->height);
-}
-
 if ((avctx->extradata_size >= 9 &&
  !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) 
||
 avctx->codec_tag == MKTAG('c','y','u','v') ||
@@ -168,11 +155,25 @@ static int raw_decode(AVCodecContext *avctx, void *data, 
int *got_frame,
 int buf_size   = avpkt->size;
 int linesize_align = 4;
 int res, len;
-int need_copy  = !avpkt->buf || context->is_2_4_bpp || 
context->is_yuv2 || context->is_lt_16bpp;
+int need_copy;
 
 AVFrame   *frame   = data;
 AVPicture *picture = data;
 
+if ((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 
2) &&
+avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
+   (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))) {
+context->is_2_4_bpp = 1;
+context->frame_size = avpicture_get_size(avctx->pix_fmt,
+ FFALIGN(avctx->width, 16),
+ avctx->height);
+} else {
+context->is_lt_16bpp = av_get_bits_per_pixel(desc) == 16 && 
avctx->bits_per_coded_sample && avctx->bits_per_coded_sample < 16;
+context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
+ avctx->height);
+}
+need_copy = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2 || 
context->is_lt_16bpp;
+
 frame->pict_type= AV_PICTURE_TYPE_I;
 frame->key_frame= 1;
 
@@ -368,4 +369,5 @@ AVCodec ff_rawvideo_decoder = {
 .close  = raw_close_decoder,
 .decode = raw_decode,
 .priv_class = &rawdec_class,
+.capabilities   = CODEC_CAP_PARAM_CHANGE,
 };

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/swfdec: Use side data to communicate w/h changes to the decoder

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
05:22:26 2014 +0200| [1c55d0ff3202a04ebc67a72d72391104e9bdb633] | committer: 
Michael Niedermayer

avformat/swfdec: Use side data to communicate w/h changes to the decoder

Fixes reading from freed data
Fixes part of Ticket3539

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1c55d0ff3202a04ebc67a72d72391104e9bdb633
---

 libavformat/swfdec.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 0f78b17..ca2a1c4 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -353,11 +353,15 @@ static int swf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
 st = vst;
 }
-st->codec->width  = width;
-st->codec->height = height;
 
 if ((res = av_new_packet(pkt, out_len - colormapsize * 
colormapbpp)) < 0)
 goto bitmap_end;
+if (!st->codec->width && !st->codec->height) {
+st->codec->width  = width;
+st->codec->height = height;
+} else {
+ff_add_param_change(pkt, 0, 0, 0, width, height);
+}
 pkt->pos = pos;
 pkt->stream_index = st->index;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] cmdutils: Add some whitespace when printing layouts

2014-09-02 Thread Tobias Rapp
ffmpeg | branch: master | Tobias Rapp  | Tue Sep  2 
16:20:45 2014 +0200| [2c43cfe2d4051c14c18d904c830d4f0a2b1dbef1] | committer: 
Michael Niedermayer

cmdutils: Add some whitespace when printing layouts

Adds some more whitespace between channel layout name and decomposition.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c43cfe2d4051c14c18d904c830d4f0a2b1dbef1
---

 cmdutils.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index a71c7db..1143ea1 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1639,19 +1639,19 @@ int show_layouts(void *optctx, const char *opt, const 
char *arg)
 const char *name, *descr;
 
 printf("Individual channels:\n"
-   "NAMEDESCRIPTION\n");
+   "NAME   DESCRIPTION\n");
 for (i = 0; i < 63; i++) {
 name = av_get_channel_name((uint64_t)1 << i);
 if (!name)
 continue;
 descr = av_get_channel_description((uint64_t)1 << i);
-printf("%-12s%s\n", name, descr);
+printf("%-14s %s\n", name, descr);
 }
 printf("\nStandard channel layouts:\n"
-   "NAMEDECOMPOSITION\n");
+   "NAME   DECOMPOSITION\n");
 for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) {
 if (name) {
-printf("%-12s", name);
+printf("%-14s ", name);
 for (j = 1; j; j <<= 1)
 if ((layout & j))
 printf("%s%s", (layout & (j - 1)) ? "+" : "", 
av_get_channel_name(j));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rl.h: remove deprecated and now unused vlc member.

2014-09-02 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Sun Aug 
31 14:05:49 2014 +0200| [2ca78936c7d4862100b7eb9b4c6097b063d495c8] | committer: 
Reimar Döffinger

rl.h: remove deprecated and now unused vlc member.

Signed-off-by: Reimar Döffinger 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ca78936c7d4862100b7eb9b4c6097b063d495c8
---

 libavcodec/mpeg12.c|   13 +++--
 libavcodec/mpegvideo.c |8 
 libavcodec/rl.h|8 
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 27d680f..cb00baf 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -70,21 +70,22 @@ static const uint8_t table_mb_btype[11][2] = {
 #define INIT_2D_VLC_RL(rl, static_size)\
 {\
 static RL_VLC_ELEM rl_vlc_table[static_size];\
-INIT_VLC_STATIC(&rl.vlc, TEX_VLC_BITS, rl.n + 2,\
+VLC tmp_vlc;\
+INIT_VLC_STATIC(&tmp_vlc, TEX_VLC_BITS, rl.n + 2,\
 &rl.table_vlc[0][1], 4, 2,\
 &rl.table_vlc[0][0], 4, 2, static_size);\
 \
 rl.rl_vlc[0] = rl_vlc_table;\
-init_2d_vlc_rl(&rl);\
+init_2d_vlc_rl(&rl, &tmp_vlc);\
 }
 
-static av_cold void init_2d_vlc_rl(RLTable *rl)
+static av_cold void init_2d_vlc_rl(RLTable *rl, const VLC *vlc)
 {
 int i;
 
-for (i = 0; i < rl->vlc.table_size; i++) {
-int code = rl->vlc.table[i][0];
-int len  = rl->vlc.table[i][1];
+for (i = 0; i < vlc->table_size; i++) {
+int code = vlc->table[i][0];
+int len  = vlc->table[i][1];
 int level, run;
 
 if (len == 0) { // illegal code
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 3ec81ce..748dbc8 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1618,7 +1618,7 @@ av_cold void ff_init_rl(RLTable *rl,
 }
 }
 
-av_cold void ff_init_vlc_rl(RLTable *rl)
+av_cold void ff_init_vlc_rl(RLTable *rl, const VLC *vlc)
 {
 int i, q;
 
@@ -1630,9 +1630,9 @@ av_cold void ff_init_vlc_rl(RLTable *rl)
 qmul = 1;
 qadd = 0;
 }
-for (i = 0; i < rl->vlc.table_size; i++) {
-int code = rl->vlc.table[i][0];
-int len  = rl->vlc.table[i][1];
+for (i = 0; i < vlc->table_size; i++) {
+int code = vlc->table[i][0];
+int len  = vlc->table[i][1];
 int level, run;
 
 if (len == 0) { // illegal code
diff --git a/libavcodec/rl.h b/libavcodec/rl.h
index c80283d..3cef366 100644
--- a/libavcodec/rl.h
+++ b/libavcodec/rl.h
@@ -44,7 +44,6 @@ typedef struct RLTable {
 uint8_t *index_run[2]; ///< encoding only
 int8_t *max_level[2];  ///< encoding & decoding
 int8_t *max_run[2];///< encoding & decoding
-VLC vlc;   ///< decoding only deprecated FIXME remove
 RL_VLC_ELEM *rl_vlc[32];   ///< decoding only
 } RLTable;
 
@@ -54,13 +53,14 @@ typedef struct RLTable {
  * the level and run tables, if this is NULL av_malloc() 
will be used
  */
 void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 
3]);
-void ff_init_vlc_rl(RLTable *rl);
+void ff_init_vlc_rl(RLTable *rl, const VLC *vlc);
 
 #define INIT_VLC_RL(rl, static_size)\
 {\
 int q;\
 static RL_VLC_ELEM rl_vlc_table[32][static_size];\
-INIT_VLC_STATIC(&rl.vlc, 9, rl.n + 1,\
+VLC tmp_vlc;\
+INIT_VLC_STATIC(&tmp_vlc, 9, rl.n + 1,\
  &rl.table_vlc[0][1], 4, 2,\
  &rl.table_vlc[0][0], 4, 2, static_size);\
 \
@@ -68,7 +68,7 @@ void ff_init_vlc_rl(RLTable *rl);
 for(q=0; q<32; q++)\
 rl.rl_vlc[q]= rl_vlc_table[q];\
 \
-ff_init_vlc_rl(&rl);\
+ff_init_vlc_rl(&rl, &tmp_vlc);\
 }\
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vf_deshake: reduce stack usage.

2014-09-02 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Mon Sep 
 1 23:36:29 2014 +0200| [4ea8406e38112bc374367386966d3a4c7357916c] | committer: 
Reimar Döffinger

vf_deshake: reduce stack usage.

Signed-off-by: Reimar Döffinger 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ea8406e38112bc374367386966d3a4c7357916c
---

 libavfilter/deshake.h|3 +++
 libavfilter/vf_deshake.c |   13 +
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/deshake.h b/libavfilter/deshake.h
index f61ed80..20df88f 100644
--- a/libavfilter/deshake.h
+++ b/libavfilter/deshake.h
@@ -71,8 +71,11 @@ typedef struct {
 
 #endif
 
+#define MAX_R 64
+
 typedef struct {
 const AVClass *class;
+int counts[2*MAX_R+1][2*MAX_R+1]; /// < Scratch buffer for motion search
 AVFrame *ref;  ///< Previous frame
 int rx;///< Maximum horizontal shift
 int ry;///< Maximum vertical shift
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index 95a6c51..6514421 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -67,8 +67,6 @@
 #define OFFSET(x) offsetof(DeshakeContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
-#define MAX_R 64
-
 static const AVOption deshake_options[] = {
 { "x", "set x for the rectangular search area",  OFFSET(cx), 
AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, .flags = FLAGS },
 { "y", "set y for the rectangular search area",  OFFSET(cy), 
AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, .flags = FLAGS },
@@ -242,7 +240,6 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 {
 int x, y;
 IntMotionVector mv = {0, 0};
-int counts[2*MAX_R+1][2*MAX_R+1];
 int count_max_value = 0;
 int contrast;
 
@@ -254,7 +251,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 // Reset counts to zero
 for (x = 0; x < deshake->rx * 2 + 1; x++) {
 for (y = 0; y < deshake->ry * 2 + 1; y++) {
-counts[x][y] = 0;
+deshake->counts[x][y] = 0;
 }
 }
 
@@ -270,7 +267,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 //av_log(NULL, AV_LOG_ERROR, "%d\n", contrast);
 find_block_motion(deshake, src1, src2, x, y, stride, &mv);
 if (mv.x != -1 && mv.y != -1) {
-counts[mv.x + deshake->rx][mv.y + deshake->ry] += 1;
+deshake->counts[mv.x + deshake->rx][mv.y + deshake->ry] += 
1;
 if (x > deshake->rx && y > deshake->ry)
 angles[pos++] = block_angle(x, y, 0, 0, &mv);
 
@@ -294,11 +291,11 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 // Find the most common motion vector in the frame and use it as the gmv
 for (y = deshake->ry * 2; y >= 0; y--) {
 for (x = 0; x < deshake->rx * 2 + 1; x++) {
-//av_log(NULL, AV_LOG_ERROR, "%5d ", counts[x][y]);
-if (counts[x][y] > count_max_value) {
+//av_log(NULL, AV_LOG_ERROR, "%5d ", deshake->counts[x][y]);
+if (deshake->counts[x][y] > count_max_value) {
 t->vector.x = x - deshake->rx;
 t->vector.y = y - deshake->ry;
-count_max_value = counts[x][y];
+count_max_value = deshake->counts[x][y];
 }
 }
 //av_log(NULL, AV_LOG_ERROR, "\n");

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rangecoder-test: Allow running with small stack size.

2014-09-02 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Mon Sep 
 1 23:08:56 2014 +0200| [3980ab12b728fb8e14fc3a54dcd4336336a25422] | committer: 
Reimar Döffinger

rangecoder-test: Allow running with small stack size.

Signed-off-by: Reimar Döffinger 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3980ab12b728fb8e14fc3a54dcd4336336a25422
---

 libavcodec/rangecoder.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/rangecoder.c b/libavcodec/rangecoder.c
index 69150a5..29fb909 100644
--- a/libavcodec/rangecoder.c
+++ b/libavcodec/rangecoder.c
@@ -120,11 +120,12 @@ int ff_rac_terminate(RangeCoder *c)
 #include "libavutil/lfg.h"
 #include "libavutil/log.h"
 
+static uint8_t b[9 * SIZE];
+static uint8_t r[9 * SIZE];
+
 int main(void)
 {
 RangeCoder c;
-uint8_t b[9 * SIZE];
-uint8_t r[9 * SIZE];
 int i;
 uint8_t state[10];
 AVLFG prng;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vf_deshake: Avoid doing a malloc+free for every single frame.

2014-09-02 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Mon Sep 
 1 23:47:12 2014 +0200| [098af260675b601c0a02a373b53ed21b5f22] | committer: 
Reimar Döffinger

vf_deshake: Avoid doing a malloc+free for every single frame.

Signed-off-by: Reimar Döffinger 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=098af260675b601c0a02a373b53ed21b5f22
---

 libavfilter/deshake.h|2 ++
 libavfilter/vf_deshake.c |   10 ++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavfilter/deshake.h b/libavfilter/deshake.h
index 20df88f..62e81c3 100644
--- a/libavfilter/deshake.h
+++ b/libavfilter/deshake.h
@@ -76,6 +76,8 @@ typedef struct {
 typedef struct {
 const AVClass *class;
 int counts[2*MAX_R+1][2*MAX_R+1]; /// < Scratch buffer for motion search
+double *angles;///< Scratch buffer for block angles
+unsigned angles_size;
 AVFrame *ref;  ///< Previous frame
 int rx;///< Maximum horizontal shift
 int ry;///< Maximum vertical shift
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index 6514421..ccc263b 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -244,10 +244,11 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 int contrast;
 
 int pos;
-double *angles = av_malloc_array(width * height / (16 * 
deshake->blocksize), sizeof(*angles));
 int center_x = 0, center_y = 0;
 double p_x, p_y;
 
+av_fast_malloc(&deshake->angles, &deshake->angles_size, width * height / 
(16 * deshake->blocksize) * sizeof(*deshake->angles));
+
 // Reset counts to zero
 for (x = 0; x < deshake->rx * 2 + 1; x++) {
 for (y = 0; y < deshake->ry * 2 + 1; y++) {
@@ -269,7 +270,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 if (mv.x != -1 && mv.y != -1) {
 deshake->counts[mv.x + deshake->rx][mv.y + deshake->ry] += 
1;
 if (x > deshake->rx && y > deshake->ry)
-angles[pos++] = block_angle(x, y, 0, 0, &mv);
+deshake->angles[pos++] = block_angle(x, y, 0, 0, &mv);
 
 center_x += mv.x;
 center_y += mv.y;
@@ -281,7 +282,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 if (pos) {
  center_x /= pos;
  center_y /= pos;
- t->angle = clean_mean(angles, pos);
+ t->angle = clean_mean(deshake->angles, pos);
  if (t->angle < 0.001)
   t->angle = 0;
 } else {
@@ -312,7 +313,6 @@ static void find_motion(DeshakeContext *deshake, uint8_t 
*src1, uint8_t *src2,
 t->angle = av_clipf(t->angle, -0.1, 0.1);
 
 //av_log(NULL, AV_LOG_ERROR, "%d x %d\n", avg->x, avg->y);
-av_free(angles);
 }
 
 static int deshake_transform_c(AVFilterContext *ctx,
@@ -422,6 +422,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 ff_opencl_deshake_uninit(ctx);
 }
 av_frame_free(&deshake->ref);
+av_freep(&deshake->angles);
+deshake->angles_size = 0;
 if (deshake->fp)
 fclose(deshake->fp);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] rl.h: Use on-stack temporary VLC tables instead of having them static.

2014-09-02 Thread Reimar Döffinger
ffmpeg | branch: master | Reimar Döffinger  | Sun Aug 
31 20:07:40 2014 +0200| [e48cd2de98c3dbac998c76c54749d1b534b32ff6] | committer: 
Reimar Döffinger

rl.h: Use on-stack temporary VLC tables instead of having them static.

Signed-off-by: Reimar Döffinger 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e48cd2de98c3dbac998c76c54749d1b534b32ff6
---

 libavcodec/mpeg12.c|   21 ++---
 libavcodec/mpegvideo.c |   12 
 libavcodec/rl.h|8 ++--
 3 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index cb00baf..fc43a53 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -70,22 +70,21 @@ static const uint8_t table_mb_btype[11][2] = {
 #define INIT_2D_VLC_RL(rl, static_size)\
 {\
 static RL_VLC_ELEM rl_vlc_table[static_size];\
-VLC tmp_vlc;\
-INIT_VLC_STATIC(&tmp_vlc, TEX_VLC_BITS, rl.n + 2,\
-&rl.table_vlc[0][1], 4, 2,\
-&rl.table_vlc[0][0], 4, 2, static_size);\
-\
 rl.rl_vlc[0] = rl_vlc_table;\
-init_2d_vlc_rl(&rl, &tmp_vlc);\
+init_2d_vlc_rl(&rl, static_size);\
 }
 
-static av_cold void init_2d_vlc_rl(RLTable *rl, const VLC *vlc)
+static av_cold void init_2d_vlc_rl(RLTable *rl, unsigned static_size)
 {
 int i;
-
-for (i = 0; i < vlc->table_size; i++) {
-int code = vlc->table[i][0];
-int len  = vlc->table[i][1];
+VLC_TYPE table[680][2] = {{0}};
+VLC vlc = { .table = table, .table_allocated = static_size };
+av_assert0(static_size <= FF_ARRAY_ELEMS(table));
+init_vlc(&vlc, TEX_VLC_BITS, rl->n + 2, &rl->table_vlc[0][1], 4, 2, 
&rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
+
+for (i = 0; i < vlc.table_size; i++) {
+int code = vlc.table[i][0];
+int len  = vlc.table[i][1];
 int level, run;
 
 if (len == 0) { // illegal code
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 748dbc8..85cb41d 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1618,9 +1618,13 @@ av_cold void ff_init_rl(RLTable *rl,
 }
 }
 
-av_cold void ff_init_vlc_rl(RLTable *rl, const VLC *vlc)
+av_cold void ff_init_vlc_rl(RLTable *rl, unsigned static_size)
 {
 int i, q;
+VLC_TYPE table[1500][2] = {{0}};
+VLC vlc = { .table = table, .table_allocated = static_size };
+av_assert0(static_size <= FF_ARRAY_ELEMS(table));
+init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, 
&rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
 
 for (q = 0; q < 32; q++) {
 int qmul = q * 2;
@@ -1630,9 +1634,9 @@ av_cold void ff_init_vlc_rl(RLTable *rl, const VLC *vlc)
 qmul = 1;
 qadd = 0;
 }
-for (i = 0; i < vlc->table_size; i++) {
-int code = vlc->table[i][0];
-int len  = vlc->table[i][1];
+for (i = 0; i < vlc.table_size; i++) {
+int code = vlc.table[i][0];
+int len  = vlc.table[i][1];
 int level, run;
 
 if (len == 0) { // illegal code
diff --git a/libavcodec/rl.h b/libavcodec/rl.h
index 3cef366..2897ec5 100644
--- a/libavcodec/rl.h
+++ b/libavcodec/rl.h
@@ -53,22 +53,18 @@ typedef struct RLTable {
  * the level and run tables, if this is NULL av_malloc() 
will be used
  */
 void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 
3]);
-void ff_init_vlc_rl(RLTable *rl, const VLC *vlc);
+void ff_init_vlc_rl(RLTable *rl, unsigned static_size);
 
 #define INIT_VLC_RL(rl, static_size)\
 {\
 int q;\
 static RL_VLC_ELEM rl_vlc_table[32][static_size];\
-VLC tmp_vlc;\
-INIT_VLC_STATIC(&tmp_vlc, 9, rl.n + 1,\
- &rl.table_vlc[0][1], 4, 2,\
- &rl.table_vlc[0][0], 4, 2, static_size);\
 \
 if(!rl.rl_vlc[0]){\
 for(q=0; q<32; q++)\
 rl.rl_vlc[q]= rl_vlc_table[q];\
 \
-ff_init_vlc_rl(&rl, &tmp_vlc);\
+ff_init_vlc_rl(&rl, static_size);\
 }\
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] 8svx: Return proper error codes

2014-09-02 Thread Gabriel Dume
ffmpeg | branch: master | Gabriel Dume  | Mon Sep  1 
15:18:57 2014 -0400| [74512f7e369da40e1148c92b58cd8e59f7737b8f] | committer: 
Diego Biurrun

8svx: Return proper error codes

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74512f7e369da40e1148c92b58cd8e59f7737b8f
---

 libavcodec/8svx.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index 11fbf19..b973771 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -96,11 +96,11 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, 
void *data,
 
 if (avpkt->size < hdr_size * avctx->channels) {
 av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 if (esc->data[0]) {
 av_log(avctx, AV_LOG_ERROR, "unexpected data after first 
packet\n");
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 
 if (is_compr) {
@@ -125,7 +125,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, 
void *data,
 }
 if (!esc->data[0]) {
 av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 
 /* decode next piece of data from the buffer */
@@ -166,7 +166,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext 
*avctx)
 
 if (avctx->channels < 1 || avctx->channels > 2) {
 av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 
channels\n");
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 
 switch(avctx->codec->id) {
@@ -179,7 +179,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext 
*avctx)
 case AV_CODEC_ID_PCM_S8_PLANAR:
 break;
 default:
-  return -1;
+  return AVERROR_INVALIDDATA;
 }
 avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '74512f7e369da40e1148c92b58cd8e59f7737b8f'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
21:45:58 2014 +0200| [50c6bffb67d140bcf4b28d0b4495648b9f6b07f9] | committer: 
Michael Niedermayer

Merge commit '74512f7e369da40e1148c92b58cd8e59f7737b8f'

* commit '74512f7e369da40e1148c92b58cd8e59f7737b8f':
  8svx: Return proper error codes

Conflicts:
libavcodec/8svx.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50c6bffb67d140bcf4b28d0b4495648b9f6b07f9
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


Re: [FFmpeg-cvslog] 8svx: Return proper error codes

2014-09-02 Thread Clément Bœsch
On Tue, Sep 02, 2014 at 09:54:31PM +0200, Gabriel Dume wrote:
> ffmpeg | branch: master | Gabriel Dume  | Mon Sep  1 
> 15:18:57 2014 -0400| [74512f7e369da40e1148c92b58cd8e59f7737b8f] | committer: 
> Diego Biurrun
> 
> 8svx: Return proper error codes
> 
> Signed-off-by: Diego Biurrun 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74512f7e369da40e1148c92b58cd8e59f7737b8f
> ---
> 
>  libavcodec/8svx.c |   10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
> index 11fbf19..b973771 100644
> --- a/libavcodec/8svx.c
> +++ b/libavcodec/8svx.c
> @@ -96,11 +96,11 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, 
> void *data,
>  
>  if (avpkt->size < hdr_size * avctx->channels) {
>  av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
> -return AVERROR(EINVAL);
> +return AVERROR_INVALIDDATA;
>  }
>  if (esc->data[0]) {
>  av_log(avctx, AV_LOG_ERROR, "unexpected data after first 
> packet\n");
> -return AVERROR(EINVAL);
> +return AVERROR_INVALIDDATA;
>  }
>  
>  if (is_compr) {
> @@ -125,7 +125,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, 
> void *data,
>  }
>  if (!esc->data[0]) {
>  av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
> -return AVERROR(EINVAL);
> +return AVERROR_INVALIDDATA;
>  }
>  
>  /* decode next piece of data from the buffer */
> @@ -166,7 +166,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext 
> *avctx)
>  
>  if (avctx->channels < 1 || avctx->channels > 2) {
>  av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 
> channels\n");
> -return AVERROR(EINVAL);
> +return AVERROR_INVALIDDATA;

Isn't this a user settable option? EINVAL was appropriate then.

>  }
>  
>  switch(avctx->codec->id) {
> @@ -179,7 +179,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext 
> *avctx)
>  case AV_CODEC_ID_PCM_S8_PLANAR:
>  break;
>  default:
> -  return -1;
> +  return AVERROR_INVALIDDATA;

AVERROR_BUG, or EINVAL maybe?

Unless I'm mistaken this is set depending on the selected decoder. It
looks unrelated to the stream data anyway.

[...]

-- 
Clément B.


pgpYR6LpTLLW9.pgp
Description: PGP signature
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'f61e47dd68582529bcf6d42d861c70a320cd1b67'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
21:57:46 2014 +0200| [4c73128d2bc6d9646808b7599224450932c6] | committer: 
Michael Niedermayer

Merge commit 'f61e47dd68582529bcf6d42d861c70a320cd1b67'

* commit 'f61e47dd68582529bcf6d42d861c70a320cd1b67':
  asv: K&R formatting cosmetics

Conflicts:
libavcodec/asvdec.c
libavcodec/asvenc.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c73128d2bc6d9646808b7599224450932c6
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] asv: K&R formatting cosmetics

2014-09-02 Thread Gabriel Dume
ffmpeg | branch: master | Gabriel Dume  | Mon Sep  1 
15:18:58 2014 -0400| [f61e47dd68582529bcf6d42d861c70a320cd1b67] | committer: 
Diego Biurrun

asv: K&R formatting cosmetics

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f61e47dd68582529bcf6d42d861c70a320cd1b67
---

 libavcodec/asv.c|   77 
 libavcodec/asv.h|2 +-
 libavcodec/asvdec.c |   55 ++--
 libavcodec/asvenc.c |  249 +--
 4 files changed, 210 insertions(+), 173 deletions(-)

diff --git a/libavcodec/asv.c b/libavcodec/asv.c
index 71c5e5f..b9e93f7 100644
--- a/libavcodec/asv.c
+++ b/libavcodec/asv.c
@@ -30,65 +30,66 @@
 #include "bswapdsp.h"
 
 const uint8_t ff_asv_scantab[64] = {
-0x00,0x08,0x01,0x09,0x10,0x18,0x11,0x19,
-0x02,0x0A,0x03,0x0B,0x12,0x1A,0x13,0x1B,
-0x04,0x0C,0x05,0x0D,0x20,0x28,0x21,0x29,
-0x06,0x0E,0x07,0x0F,0x14,0x1C,0x15,0x1D,
-0x22,0x2A,0x23,0x2B,0x30,0x38,0x31,0x39,
-0x16,0x1E,0x17,0x1F,0x24,0x2C,0x25,0x2D,
-0x32,0x3A,0x33,0x3B,0x26,0x2E,0x27,0x2F,
-0x34,0x3C,0x35,0x3D,0x36,0x3E,0x37,0x3F,
+0x00, 0x08, 0x01, 0x09, 0x10, 0x18, 0x11, 0x19,
+0x02, 0x0A, 0x03, 0x0B, 0x12, 0x1A, 0x13, 0x1B,
+0x04, 0x0C, 0x05, 0x0D, 0x20, 0x28, 0x21, 0x29,
+0x06, 0x0E, 0x07, 0x0F, 0x14, 0x1C, 0x15, 0x1D,
+0x22, 0x2A, 0x23, 0x2B, 0x30, 0x38, 0x31, 0x39,
+0x16, 0x1E, 0x17, 0x1F, 0x24, 0x2C, 0x25, 0x2D,
+0x32, 0x3A, 0x33, 0x3B, 0x26, 0x2E, 0x27, 0x2F,
+0x34, 0x3C, 0x35, 0x3D, 0x36, 0x3E, 0x37, 0x3F,
 };
 
 const uint8_t ff_asv_ccp_tab[17][2] = {
-{0x2,2}, {0x7,5}, {0xB,5}, {0x3,5},
-{0xD,5}, {0x5,5}, {0x9,5}, {0x1,5},
-{0xE,5}, {0x6,5}, {0xA,5}, {0x2,5},
-{0xC,5}, {0x4,5}, {0x8,5}, {0x3,2},
-{0xF,5}, //EOB
+{ 0x2, 2 }, { 0x7, 5 }, { 0xB, 5 }, { 0x3, 5 },
+{ 0xD, 5 }, { 0x5, 5 }, { 0x9, 5 }, { 0x1, 5 },
+{ 0xE, 5 }, { 0x6, 5 }, { 0xA, 5 }, { 0x2, 5 },
+{ 0xC, 5 }, { 0x4, 5 }, { 0x8, 5 }, { 0x3, 2 },
+{ 0xF, 5 }, // EOB
 };
 
 const uint8_t ff_asv_level_tab[7][2] = {
-{3,4}, {3,3}, {3,2}, {0,3}, {2,2}, {2,3}, {2,4}
+{ 3, 4 }, { 3, 3 }, { 3, 2 }, { 0, 3 }, { 2, 2 }, { 2, 3 }, { 2, 4 }
 };
 
 const uint8_t ff_asv_dc_ccp_tab[8][2] = {
-{0x1,2}, {0xD,4}, {0xF,4}, {0xC,4},
-{0x5,3}, {0xE,4}, {0x4,3}, {0x0,2},
+{ 0x1, 2 }, { 0xD, 4 }, { 0xF, 4 }, { 0xC, 4 },
+{ 0x5, 3 }, { 0xE, 4 }, { 0x4, 3 }, { 0x0, 2 },
 };
 
 const uint8_t ff_asv_ac_ccp_tab[16][2] = {
-{0x00,2}, {0x3B,6}, {0x0A,4}, {0x3A,6},
-{0x02,3}, {0x39,6}, {0x3C,6}, {0x38,6},
-{0x03,3}, {0x3D,6}, {0x08,4}, {0x1F,5},
-{0x09,4}, {0x0B,4}, {0x0D,4}, {0x0C,4},
+{ 0x00, 2 }, { 0x3B, 6 }, { 0x0A, 4 }, { 0x3A, 6 },
+{ 0x02, 3 }, { 0x39, 6 }, { 0x3C, 6 }, { 0x38, 6 },
+{ 0x03, 3 }, { 0x3D, 6 }, { 0x08, 4 }, { 0x1F, 5 },
+{ 0x09, 4 }, { 0x0B, 4 }, { 0x0D, 4 }, { 0x0C, 4 },
 };
 
 const uint8_t ff_asv2_level_tab[63][2] = {
-
{0x3F,10},{0x2F,10},{0x37,10},{0x27,10},{0x3B,10},{0x2B,10},{0x33,10},{0x23,10},
-
{0x3D,10},{0x2D,10},{0x35,10},{0x25,10},{0x39,10},{0x29,10},{0x31,10},{0x21,10},
-{0x1F, 8},{0x17, 8},{0x1B, 8},{0x13, 8},{0x1D, 8},{0x15, 8},{0x19, 
8},{0x11, 8},
-{0x0F, 6},{0x0B, 6},{0x0D, 6},{0x09, 6},
-{0x07, 4},{0x05, 4},
-{0x03, 2},
-{0x00, 5},
-{0x02, 2},
-{0x04, 4},{0x06, 4},
-{0x08, 6},{0x0C, 6},{0x0A, 6},{0x0E, 6},
-{0x10, 8},{0x18, 8},{0x14, 8},{0x1C, 8},{0x12, 8},{0x1A, 8},{0x16, 
8},{0x1E, 8},
-
{0x20,10},{0x30,10},{0x28,10},{0x38,10},{0x24,10},{0x34,10},{0x2C,10},{0x3C,10},
-
{0x22,10},{0x32,10},{0x2A,10},{0x3A,10},{0x26,10},{0x36,10},{0x2E,10},{0x3E,10},
+{ 0x3F, 10 }, { 0x2F, 10 }, { 0x37, 10 }, { 0x27, 10 }, { 0x3B, 10 }, { 
0x2B, 10 }, { 0x33, 10 }, { 0x23, 10 },
+{ 0x3D, 10 }, { 0x2D, 10 }, { 0x35, 10 }, { 0x25, 10 }, { 0x39, 10 }, { 
0x29, 10 }, { 0x31, 10 }, { 0x21, 10 },
+{ 0x1F,  8 }, { 0x17,  8 }, { 0x1B,  8 }, { 0x13,  8 }, { 0x1D,  8 }, { 
0x15,  8 }, { 0x19,  8 }, { 0x11,  8 },
+{ 0x0F,  6 }, { 0x0B,  6 }, { 0x0D,  6 }, { 0x09,  6 },
+{ 0x07,  4 }, { 0x05,  4 },
+{ 0x03,  2 },
+{ 0x00,  5 },
+{ 0x02,  2 },
+{ 0x04,  4 }, { 0x06,  4 },
+{ 0x08,  6 }, { 0x0C,  6 }, { 0x0A,  6 }, { 0x0E,  6 },
+{ 0x10,  8 }, { 0x18,  8 }, { 0x14,  8 }, { 0x1C,  8 }, { 0x12,  8 }, { 
0x1A,  8 }, { 0x16,  8 }, { 0x1E,  8 },
+{ 0x20, 10 }, { 0x30, 10 }, { 0x28, 10 }, { 0x38, 10 }, { 0x24, 10 }, { 
0x34, 10 }, { 0x2C, 10 }, { 0x3C, 10 },
+{ 0x22, 10 }, { 0x32, 10 }, { 0x2A, 10 }, { 0x3A, 10 }, { 0x26, 10 }, { 
0x36, 10 }, { 0x2E, 10 }, { 0x3E, 10 },
 };
 
-av_cold void ff_asv_common_init(AVCodecContext *avctx) {
-ASV1Context * const a = avctx->priv_data;
+av_cold void ff_asv_common_init(AVCodecContext *avctx)
+{
+ASV1Context *const a = avctx->priv_data;
 
 ff_bswapdsp_init(&a->bbdsp);
 
 a->mb_width   = (avctx->width  + 15) / 16;
 a->mb_height  = (avctx->height + 15) / 16;
-a->mb_width2  = (avctx-

[FFmpeg-cvslog] Merge commit 'ff4d1aa8bc3f4fe9d1f684f760b29c51adb569ef'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
22:07:06 2014 +0200| [c8be5258dec928119fab414341b13c0cf5405294] | committer: 
Michael Niedermayer

Merge commit 'ff4d1aa8bc3f4fe9d1f684f760b29c51adb569ef'

* commit 'ff4d1aa8bc3f4fe9d1f684f760b29c51adb569ef':
  flv: K&R formatting cosmetics

Conflicts:
libavcodec/flv.h
libavcodec/flvdec.c
libavcodec/flvenc.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8be5258dec928119fab414341b13c0cf5405294
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] flv: K&R formatting cosmetics

2014-09-02 Thread Gabriel Dume
ffmpeg | branch: master | Gabriel Dume  | Mon Sep  1 
15:18:59 2014 -0400| [ff4d1aa8bc3f4fe9d1f684f760b29c51adb569ef] | committer: 
Diego Biurrun

flv: K&R formatting cosmetics

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff4d1aa8bc3f4fe9d1f684f760b29c51adb569ef
---

 libavcodec/flv.h|8 --
 libavcodec/flvdec.c |   19 ++---
 libavcodec/flvenc.c |   78 +++
 3 files changed, 56 insertions(+), 49 deletions(-)

diff --git a/libavcodec/flv.h b/libavcodec/flv.h
index 3d9a2d5..801e357 100644
--- a/libavcodec/flv.h
+++ b/libavcodec/flv.h
@@ -1,5 +1,6 @@
 /*
  * FLV specific private header.
+ *
  * This file is part of Libav.
  *
  * Libav is free software; you can redistribute it and/or
@@ -20,12 +21,13 @@
 #ifndef AVCODEC_FLV_H
 #define AVCODEC_FLV_H
 
-#include "mpegvideo.h"
 #include "get_bits.h"
+#include "mpegvideo.h"
 #include "put_bits.h"
 
-void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, 
int last);
+void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number);
+void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run,
+   int last);
 
 int ff_flv_decode_picture_header(MpegEncContext *s);
 void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last);
diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c
index 3405058..0a6f268 100644
--- a/libavcodec/flvdec.c
+++ b/libavcodec/flvdec.c
@@ -1,5 +1,6 @@
 /*
  * FLV decoding.
+ *
  * This file is part of Libav.
  *
  * Libav is free software; you can redistribute it and/or
@@ -17,21 +18,21 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "mpegvideo.h"
-#include "h263.h"
-#include "flv.h"
 #include "libavutil/imgutils.h"
 
+#include "flv.h"
+#include "h263.h"
+#include "mpegvideo.h"
+
 void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last)
 {
 int is11 = get_bits1(gb);
 *last = get_bits1(gb);
 *run  = get_bits(gb, 6);
-if (is11) {
+if (is11)
 *level = get_sbits(gb, 11);
-} else {
+else
 *level = get_sbits(gb, 7);
-}
 }
 
 int ff_flv_decode_picture_header(MpegEncContext *s)
@@ -128,8 +129,6 @@ AVCodec ff_flv_decoder = {
 .close  = ff_h263_decode_end,
 .decode = ff_h263_decode_frame,
 .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
-.pix_fmts   = (const enum AVPixelFormat[]) {
-AV_PIX_FMT_YUV420P,
-AV_PIX_FMT_NONE
-},
+.pix_fmts   = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE },
 };
diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c
index 4d5eb1d..e14a105 100644
--- a/libavcodec/flvenc.c
+++ b/libavcodec/flvenc.c
@@ -1,5 +1,6 @@
 /*
  * FLV Encoding specific code.
+ *
  * This file is part of Libav.
  *
  * Libav is free software; you can redistribute it and/or
@@ -17,58 +18,62 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "mpegvideo.h"
-#include "h263.h"
 #include "flv.h"
+#include "h263.h"
+#include "mpegvideo.h"
 
-void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
+void ff_flv_encode_picture_header(MpegEncContext *s, int picture_number)
 {
-  int format;
+int format;
 
-  avpriv_align_put_bits(&s->pb);
+avpriv_align_put_bits(&s->pb);
 
-  put_bits(&s->pb, 17, 1);
-  put_bits(&s->pb, 5, (s->h263_flv-1)); /* 0: h263 escape codes 1: 11-bit 
escape codes */
-  put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * 
s->avctx->time_base.num) / //FIXME use timestamp
-   s->avctx->time_base.den) & 0xff); /* 
TemporalReference */
-  if (s->width == 352 && s->height == 288)
+put_bits(&s->pb, 17, 1);
+/* 0: h263 escape codes 1: 11-bit escape codes */
+put_bits(&s->pb, 5, (s->h263_flv - 1));
+put_bits(&s->pb, 8,
+ (((int64_t) s->picture_number * 30 * s->avctx->time_base.num) /   
// FIXME use timestamp
+  s->avctx->time_base.den) & 0xff);   /* TemporalReference */
+if (s->width == 352 && s->height == 288)
 format = 2;
-  else if (s->width == 176 && s->height == 144)
+else if (s->width == 176 && s->height == 144)
 format = 3;
-  else if (s->width == 128 && s->height == 96)
+else if (s->width == 128 && s->height == 96)
 format = 4;
-  else if (s->width == 320 && s->height == 240)
+else if (s->width == 320 && s->height == 240)
 format = 5;
-  else if (s->width == 160 && s->height == 120)
+else if (s->width == 160 && s->height == 120)
 format = 6;
-  else if (s->width <= 255 && s->height <= 255)
-format = 0; /* use 1 byte width & height */
-  else

[FFmpeg-cvslog] Merge commit '91d305790ea0f6fe0f54b48236da42181c39c18b'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Sep  2 
22:18:12 2014 +0200| [9e59a7be1cc9bd840d91f78c55b7f4953659319b] | committer: 
Michael Niedermayer

Merge commit '91d305790ea0f6fe0f54b48236da42181c39c18b'

* commit '91d305790ea0f6fe0f54b48236da42181c39c18b':
  get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE

Conflicts:
libavcodec/golomb.h

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e59a7be1cc9bd840d91f78c55b7f4953659319b
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE

2014-09-02 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Fri Aug 22 
12:36:12 2014 +0200| [91d305790ea0f6fe0f54b48236da42181c39c18b] | committer: 
Diego Biurrun

get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE

The HAVE_ prefix is reserved for macros set by configure.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91d305790ea0f6fe0f54b48236da42181c39c18b
---

 libavcodec/get_bits.h |4 ++--
 libavcodec/golomb.h   |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 5a0089a..f1962f2 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -128,14 +128,14 @@ typedef struct RL_VLC_ELEM {
 unsigned int name ## _index = (gb)->index;  \
 unsigned int av_unused name ## _cache = 0
 
-#define HAVE_BITS_REMAINING(name, gb) 1
+#define BITS_AVAILABLE(name, gb) 1
 #else
 #define OPEN_READER(name, gb)   \
 unsigned int name ## _index = (gb)->index;  \
 unsigned int av_unused name ## _cache = 0;  \
 unsigned int av_unused name ## _size_plus8 = (gb)->size_in_bits_plus8
 
-#define HAVE_BITS_REMAINING(name, gb) name ## _index < name ## _size_plus8
+#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
 #endif
 
 #define CLOSE_READER(name, gb) (gb)->index = name ## _index
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 1754706..22a87c6 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -138,7 +138,7 @@ static inline unsigned svq3_get_ue_golomb(GetBitContext *gb)
 ret = (ret << 4) | ff_interleaved_dirac_golomb_vlc_code[buf];
 UPDATE_CACHE(re, gb);
 buf = GET_CACHE(re, gb);
-} while (HAVE_BITS_REMAINING(re, gb));
+} while (BITS_AVAILABLE(re, gb));
 
 CLOSE_READER(re, gb);
 return ret - 1;
@@ -328,7 +328,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, 
int k, int limit,
 return buf;
 } else {
 int i;
-for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0 && 
HAVE_BITS_REMAINING(re, gb); i++) {
+for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0 && 
BITS_AVAILABLE(re, gb); i++) {
 LAST_SKIP_BITS(re, gb, 1);
 UPDATE_CACHE(re, gb);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. bc326b5 web/download: Update Linux Static Build links

2014-09-02 Thread gitolite
The branch, master has been updated
   via  bc326b5464c0bd0ce3c4dc5552edf6826ebb83c9 (commit)
  from  beccedc88c4df38f233984e62c85283f9b48bb77 (commit)


- Log -
commit bc326b5464c0bd0ce3c4dc5552edf6826ebb83c9
Author: Lou Logan 
AuthorDate: Tue Sep 2 13:19:20 2014 -0800
Commit: Lou Logan 
CommitDate: Tue Sep 2 14:15:47 2014 -0800

web/download: Update Linux Static Build links

* Remove Burek's builds
These have been halted since 16 July. Burek has been notified several
times, but I have recieved no response. Link will be re-added if
activity resumes.

* Add reference to 32-bit builds to relaxed's link
Thanks to relaxed for quickly volunteering to provide 32-bit builds,
and thanks to Burek for all of his previous work.

Signed-off-by: Lou Logan 

diff --git a/src/download b/src/download
index c0a2023..03fa183 100644
--- a/src/download
+++ b/src/download
@@ -70,10 +70,8 @@
 
 Linux Static Builds
 
-  http://ffmpeg.gusari.org/static/";>32-bit and
-64-bit with kernel 3.2.x and above
-  http://johnvansickle.com/ffmpeg/";>64-bit
-with kernel 2.6.32 and above
+  http://johnvansickle.com/ffmpeg/";>32-bit and
+64-bit for kernel 2.6.32 and above
  
 


---

Summary of changes:
 src/download |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)


hooks/post-receive
-- 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] idctdsp: Add global function pointers for {add|put}_pixels_clamped functions

2014-09-02 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Sun Aug 31 
11:45:15 2014 -0700| [95c0cec03acec0a80cc1c7db48f3b2355d9e767b] | committer: 
Diego Biurrun

idctdsp: Add global function pointers for {add|put}_pixels_clamped functions

These function pointers already existed in the ARM code. Adding them globally
allows calls to the function pointers to access arch-optimized versions of the
functions transparently.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95c0cec03acec0a80cc1c7db48f3b2355d9e767b
---

 libavcodec/arm/idctdsp_init_arm.c |7 ---
 libavcodec/dct.h  |2 ++
 libavcodec/idctdsp.c  |   22 --
 libavcodec/idctdsp.h  |3 +++
 libavcodec/jrevdct.c  |   14 ++
 libavcodec/x86/simple_idct.c  |7 +--
 6 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/libavcodec/arm/idctdsp_init_arm.c 
b/libavcodec/arm/idctdsp_init_arm.c
index 0b32df0..8207c31 100644
--- a/libavcodec/arm/idctdsp_init_arm.c
+++ b/libavcodec/arm/idctdsp_init_arm.c
@@ -29,10 +29,6 @@
 #include "idct.h"
 #include "idctdsp_arm.h"
 
-/* XXX: local hack */
-static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, 
int line_size);
-static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, 
int line_size);
-
 void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
int line_size);
 
@@ -67,9 +63,6 @@ av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, 
AVCodecContext *avctx,
 {
 int cpu_flags = av_get_cpu_flags();
 
-ff_put_pixels_clamped = c->put_pixels_clamped;
-ff_add_pixels_clamped = c->add_pixels_clamped;
-
 if (!high_bit_depth) {
 if (avctx->idct_algo == FF_IDCT_AUTO ||
 avctx->idct_algo == FF_IDCT_ARM) {
diff --git a/libavcodec/dct.h b/libavcodec/dct.h
index 3fd4e27..4a31f54 100644
--- a/libavcodec/dct.h
+++ b/libavcodec/dct.h
@@ -59,5 +59,7 @@ void ff_fdct248_islow_8(int16_t *data);
 void ff_fdct248_islow_10(int16_t *data);
 
 void ff_j_rev_dct(int16_t *data);
+void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block);
+void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block);
 
 #endif /* AVCODEC_DCT_H */
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 6beb2b2..2a979bc 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -79,6 +79,9 @@ av_cold void ff_init_scantable_permutation(uint8_t 
*idct_permutation,
 }
 }
 
+void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int 
line_size);
+void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int 
line_size);
+
 static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict 
pixels,
  int line_size)
 {
@@ -141,18 +144,6 @@ static void add_pixels_clamped_c(const int16_t *block, 
uint8_t *restrict pixels,
 }
 }
 
-static void jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
-{
-ff_j_rev_dct(block);
-put_pixels_clamped_c(block, dest, line_size);
-}
-
-static void jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
-{
-ff_j_rev_dct(block);
-add_pixels_clamped_c(block, dest, line_size);
-}
-
 av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
 {
 const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
@@ -163,8 +154,8 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, 
AVCodecContext *avctx)
 c->idct  = ff_simple_idct_10;
 c->perm_type = FF_IDCT_PERM_NONE;
 } else if (avctx->idct_algo == FF_IDCT_INT) {
-c->idct_put  = jref_idct_put;
-c->idct_add  = jref_idct_add;
+c->idct_put  = ff_jref_idct_put;
+c->idct_add  = ff_jref_idct_add;
 c->idct  = ff_j_rev_dct;
 c->perm_type = FF_IDCT_PERM_LIBMPEG2;
 } else if (avctx->idct_algo == FF_IDCT_FAAN) {
@@ -183,6 +174,9 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, 
AVCodecContext *avctx)
 c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
 c->add_pixels_clamped= add_pixels_clamped_c;
 
+ff_put_pixels_clamped = c->put_pixels_clamped;
+ff_add_pixels_clamped = c->add_pixels_clamped;
+
 if (ARCH_ARM)
 ff_idctdsp_init_arm(c, avctx, high_bit_depth);
 if (ARCH_PPC)
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index b88cc82..c49a4ca 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -95,6 +95,9 @@ typedef struct IDCTDSPContext {
 enum idct_permutation_type perm_type;
 } IDCTDSPContext;
 
+extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, 
int line_size);
+extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, 
int line_size);
+
 void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
 
 void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c
index e6846a1

[FFmpeg-cvslog] Merge commit '95c0cec03acec0a80cc1c7db48f3b2355d9e767b'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed Sep  3 
03:18:07 2014 +0200| [5db23c07a3f76d31e8e3178f8bacb68289bba62b] | committer: 
Michael Niedermayer

Merge commit '95c0cec03acec0a80cc1c7db48f3b2355d9e767b'

* commit '95c0cec03acec0a80cc1c7db48f3b2355d9e767b':
  idctdsp: Add global function pointers for {add|put}_pixels_clamped functions

Conflicts:
libavcodec/arm/idctdsp_init_arm.c
libavcodec/dct.h
libavcodec/idctdsp.c
libavcodec/jrevdct.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5db23c07a3f76d31e8e3178f8bacb68289bba62b
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] xvid: Add C IDCT

2014-09-02 Thread Pascal Massimino
ffmpeg | branch: master | Pascal Massimino  | Wed 
Aug 27 02:58:10 2014 +0200| [7a1d6ddd2c6b2d66fbc1afa584cf506930a26453] | 
committer: Diego Biurrun

xvid: Add C IDCT

Thanks to Pascal Massimino and Michael Militzer for relicensing as LGPL.

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a1d6ddd2c6b2d66fbc1afa584cf506930a26453
---

 libavcodec/dct-test.c  |6 +-
 libavcodec/x86/xvididct_init.c |8 +-
 libavcodec/xvididct.c  |  322 +++-
 libavcodec/xvididct.h  |7 +-
 tests/fate/xvid.mak|5 +-
 tests/ref/fate/{xvid-idctmmx => xvid-idct} |0
 6 files changed, 337 insertions(+), 11 deletions(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index a531c88..fed5ff2 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -42,6 +42,7 @@
 #include "dct.h"
 #include "idctdsp.h"
 #include "simple_idct.h"
+#include "xvididct.h"
 #include "aandcttab.h"
 #include "faandct.h"
 #include "faanidct.h"
@@ -62,11 +63,14 @@ static const struct algo fdct_tab[4] = {
 { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
 };
 
-static const struct algo idct_tab[4] = {
+static const struct algo idct_tab[] = {
 { "FAANI",   ff_faanidct,  FF_IDCT_PERM_NONE },
 { "REF-DBL", ff_ref_idct,  FF_IDCT_PERM_NONE },
 { "INT", ff_j_rev_dct, FF_IDCT_PERM_LIBMPEG2 },
 { "SIMPLE-C",ff_simple_idct_8, FF_IDCT_PERM_NONE },
+#if CONFIG_MPEG4_DECODER
+{ "XVID",ff_xvid_idct, FF_IDCT_PERM_NONE, 0, 1 },
+#endif /* CONFIG_MPEG4_DECODER */
 };
 
 #if ARCH_ARM
diff --git a/libavcodec/x86/xvididct_init.c b/libavcodec/x86/xvididct_init.c
index ce5f240..e4f7345 100644
--- a/libavcodec/x86/xvididct_init.c
+++ b/libavcodec/x86/xvididct_init.c
@@ -26,10 +26,16 @@
 #include "idctdsp.h"
 #include "xvididct.h"
 
-av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c)
+av_cold void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
+   unsigned high_bit_depth)
 {
 int cpu_flags = av_get_cpu_flags();
 
+if (high_bit_depth ||
+!(avctx->idct_algo == FF_IDCT_AUTO ||
+  avctx->idct_algo == FF_IDCT_XVID))
+return;
+
 if (INLINE_MMX(cpu_flags)) {
 c->idct_put  = ff_xvid_idct_mmx_put;
 c->idct_add  = ff_xvid_idct_mmx_add;
diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c
index 0562fdb..ca89703 100644
--- a/libavcodec/xvididct.c
+++ b/libavcodec/xvididct.c
@@ -1,4 +1,8 @@
 /*
+ * Xvid MPEG-4 IDCT
+ *
+ * Copyright (C) 2006-2011 Xvid Solutions GmbH
+ *
  * This file is part of Libav.
  *
  * Libav is free software; you can redistribute it and/or
@@ -16,23 +20,331 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/**
+ * @file
+ * Walken IDCT
+ * Alternative IDCT implementation for decoding compatibility.
+ *
+ * @author Skal
+ * @note This C version is not the original IDCT, but a modified one that
+ *   yields the same error profile as the MMX/MMXEXT/SSE2 versions.
+ */
+
 #include "config.h"
 #include "libavutil/attributes.h"
 #include "avcodec.h"
 #include "idctdsp.h"
 #include "xvididct.h"
 
+#define ROW_SHIFT 11
+#define COL_SHIFT  6
+
+// #define FIX(x)   (int)((x) * (1 << ROW_SHIFT))
+#define RND0 65536 // 1 << (COL_SHIFT + ROW_SHIFT - 1);
+#define RND1 3597  // FIX (1.75683487303);
+#define RND2 2260  // FIX (1.10355339059);
+#define RND3 1203  // FIX (0.587788325588);
+#define RND4 0
+#define RND5 120   // FIX (0.058658283817);
+#define RND6 512   // FIX (0.25);
+#define RND7 512   // FIX (0.25);
+
+static const int TAB04[] = { 22725, 21407, 19266, 16384, 12873,  8867, 4520 };
+static const int TAB17[] = { 31521, 29692, 26722, 22725, 17855, 12299, 6270 };
+static const int TAB26[] = { 29692, 27969, 25172, 21407, 16819, 11585, 5906 };
+static const int TAB35[] = { 26722, 25172, 22654, 19266, 15137, 10426, 5315 };
+
+static int idct_row(short *in, const int *const tab, int rnd)
+{
+const int c1 = tab[0];
+const int c2 = tab[1];
+const int c3 = tab[2];
+const int c4 = tab[3];
+const int c5 = tab[4];
+const int c6 = tab[5];
+const int c7 = tab[6];
+
+const int right = in[5] | in[6] | in[7];
+const int left  = in[1] | in[2] | in[3];
+if (!(right | in[4])) {
+const int k = c4 * in[0] + rnd;
+if (left) {
+const int a0 = k + c2 * in[2];
+const int a1 = k + c6 * in[2];
+const int a2 = k - c6 * in[2];
+const int a3 = k - c2 * in[2];
+
+const int b0 = c1 * in[1] + c3 * in[3];
+const int b1 = c3 * in[1] - c7 * in[3];
+const int b2 = c5 * in[1] - c1 * in[3];
+const int b3 = c7 * in[1] - c5 * in[3];
+
+in[0] = (a0 + b0) >> ROW_SHIFT;
+in[1] = (a1 + b1) >> ROW_SHIFT;

[FFmpeg-cvslog] Merge commit '7a1d6ddd2c6b2d66fbc1afa584cf506930a26453'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed Sep  3 
03:55:23 2014 +0200| [5b58d79a99658200ee5562999b16b5a8fa729b22] | committer: 
Michael Niedermayer

Merge commit '7a1d6ddd2c6b2d66fbc1afa584cf506930a26453'

* commit '7a1d6ddd2c6b2d66fbc1afa584cf506930a26453':
  xvid: Add C IDCT

Conflicts:
libavcodec/dct-test.c
libavcodec/xvididct.c

See: 298b3b6c1f8f66b9bc6de53a7b51d3de745d946b
Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b58d79a99658200ee5562999b16b5a8fa729b22
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] wmv2: K&R formatting cosmetics

2014-09-02 Thread Gabriel Dume
ffmpeg | branch: master | Gabriel Dume  | Tue Sep  2 
15:28:51 2014 -0400| [eda7571ea1a41c835e3a02fa9517e5bc67d7adce] | committer: 
Diego Biurrun

wmv2: K&R formatting cosmetics

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eda7571ea1a41c835e3a02fa9517e5bc67d7adce
---

 libavcodec/wmv2.c|  131 +++---
 libavcodec/wmv2.h|8 +-
 libavcodec/wmv2dec.c |  459 ++
 libavcodec/wmv2enc.c |  146 
 4 files changed, 382 insertions(+), 362 deletions(-)

diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index 7b1ea57..555d30e 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -26,8 +26,9 @@
 #include "wmv2.h"
 
 
-av_cold void ff_wmv2_common_init(Wmv2Context * w){
-MpegEncContext * const s= &w->s;
+av_cold void ff_wmv2_common_init(Wmv2Context *w)
+{
+MpegEncContext *const s = &w->s;
 
 ff_blockdsp_init(&s->bdsp, s->avctx);
 ff_wmv2dsp_init(&w->wdsp);
@@ -51,84 +52,87 @@ av_cold void ff_wmv2_common_init(Wmv2Context * w){
 s->idsp.idct = NULL;
 }
 
-static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int 
stride, int n){
-MpegEncContext * const s= &w->s;
-
-  if (s->block_last_index[n] >= 0) {
-switch(w->abt_type_table[n]){
-case 0:
-w->wdsp.idct_add(dst, stride, block1);
-break;
-case 1:
-ff_simple_idct84_add(dst   , stride, block1);
-ff_simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]);
-s->bdsp.clear_block(w->abt_block2[n]);
-break;
-case 2:
-ff_simple_idct48_add(dst   , stride, block1);
-ff_simple_idct48_add(dst + 4   , stride, w->abt_block2[n]);
-s->bdsp.clear_block(w->abt_block2[n]);
-break;
-default:
-av_log(s->avctx, AV_LOG_ERROR, "internal error in WMV2 abt\n");
+static void wmv2_add_block(Wmv2Context *w, int16_t *block1,
+   uint8_t *dst, int stride, int n)
+{
+MpegEncContext *const s = &w->s;
+
+if (s->block_last_index[n] >= 0) {
+switch (w->abt_type_table[n]) {
+case 0:
+w->wdsp.idct_add(dst, stride, block1);
+break;
+case 1:
+ff_simple_idct84_add(dst, stride, block1);
+ff_simple_idct84_add(dst + 4 * stride, stride, w->abt_block2[n]);
+s->bdsp.clear_block(w->abt_block2[n]);
+break;
+case 2:
+ff_simple_idct48_add(dst, stride, block1);
+ff_simple_idct48_add(dst + 4, stride, w->abt_block2[n]);
+s->bdsp.clear_block(w->abt_block2[n]);
+break;
+default:
+av_log(s->avctx, AV_LOG_ERROR, "internal error in WMV2 abt\n");
+}
 }
-  }
 }
 
-void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, 
uint8_t *dest_cb, uint8_t *dest_cr){
-Wmv2Context * const w= (Wmv2Context*)s;
+void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64],
+uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr)
+{
+Wmv2Context *const w = (Wmv2Context *) s;
 
-wmv2_add_block(w, block1[0], dest_y, s->linesize, 0);
-wmv2_add_block(w, block1[1], dest_y + 8, s->linesize, 1);
-wmv2_add_block(w, block1[2], dest_y + 8*s->linesize, s->linesize, 2);
-wmv2_add_block(w, block1[3], dest_y + 8 + 8*s->linesize, s->linesize, 3);
+wmv2_add_block(w, block1[0], dest_y,   s->linesize, 0);
+wmv2_add_block(w, block1[1], dest_y + 8,   s->linesize, 1);
+wmv2_add_block(w, block1[2], dest_y + 8 * s->linesize, s->linesize, 2);
+wmv2_add_block(w, block1[3], dest_y + 8 + 8 * s->linesize, s->linesize, 3);
 
-if(s->flags&CODEC_FLAG_GRAY) return;
+if (s->flags & CODEC_FLAG_GRAY)
+return;
 
-wmv2_add_block(w, block1[4], dest_cb   , s->uvlinesize, 4);
-wmv2_add_block(w, block1[5], dest_cr   , s->uvlinesize, 5);
+wmv2_add_block(w, block1[4], dest_cb, s->uvlinesize, 4);
+wmv2_add_block(w, block1[5], dest_cr, s->uvlinesize, 5);
 }
 
-void ff_mspel_motion(MpegEncContext *s,
-   uint8_t *dest_y, uint8_t *dest_cb, uint8_t 
*dest_cr,
-   uint8_t **ref_picture, op_pixels_func 
(*pix_op)[4],
-   int motion_x, int motion_y, int h)
+void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y,
+ uint8_t *dest_cb, uint8_t *dest_cr,
+ uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
+ int motion_x, int motion_y, int h)
 {
-Wmv2Context * const w= (Wmv2Context*)s;
+Wmv2Context *const w = (Wmv2Context *) s;
 uint8_t *ptr;
 int dxy, offset, mx, my, src_x, src_y, v_edge_pos;
 ptrdiff_t linesize, uvlinesize;
-int emu=0;
+int emu = 0;
 
-dxy = ((motion_y & 1) << 1) | (motion_x

[FFmpeg-cvslog] Merge commit 'eda7571ea1a41c835e3a02fa9517e5bc67d7adce'

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed Sep  3 
04:13:37 2014 +0200| [feac9cbed0602503e9100dd2257ddc0d46e1929d] | committer: 
Michael Niedermayer

Merge commit 'eda7571ea1a41c835e3a02fa9517e5bc67d7adce'

* commit 'eda7571ea1a41c835e3a02fa9517e5bc67d7adce':
  wmv2: K&R formatting cosmetics

Conflicts:
libavcodec/wmv2.c
libavcodec/wmv2dec.c
libavcodec/wmv2enc.c

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=feac9cbed0602503e9100dd2257ddc0d46e1929d
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mpeg4videodec: fix automatic use of the xvid idct on non x86

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed Sep  3 
05:18:09 2014 +0200| [50841da1433126b02c7dc0cc39cf1ee718509be6] | committer: 
Michael Niedermayer

avcodec/mpeg4videodec: fix automatic use of the xvid idct on non x86

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50841da1433126b02c7dc0cc39cf1ee718509be6
---

 libavcodec/mpeg4videodec.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 31bc67b..99c7429 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2209,16 +2209,13 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
s->workaround_bugs, ctx->lavc_build, ctx->xvid_build,
ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");
 
-#if HAVE_MMX
 if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 &&
 s->codec_id == AV_CODEC_ID_MPEG4 &&
-avctx->idct_algo == FF_IDCT_AUTO &&
-(av_get_cpu_flags() & AV_CPU_FLAG_MMX)) {
+avctx->idct_algo == FF_IDCT_AUTO) {
 avctx->idct_algo = FF_IDCT_XVID;
 ff_mpv_idct_init(s);
 return 1;
 }
-#endif
 
 return 0;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/idctdsp: Initialize ff_put/ add_pixels_clamped correctly so that the optimized functions are also used

2014-09-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed Sep  3 
04:52:50 2014 +0200| [928cb84b32b639841ac1ec2957155a6abd53309f] | committer: 
Michael Niedermayer

avcodec/idctdsp: Initialize ff_put/add_pixels_clamped correctly so that the 
optimized functions are also used

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=928cb84b32b639841ac1ec2957155a6abd53309f
---

 libavcodec/idctdsp.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index cf12f16..19e8126 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -292,9 +292,6 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, 
AVCodecContext *avctx)
 c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
 c->add_pixels_clamped= add_pixels_clamped_c;
 
-ff_put_pixels_clamped = c->put_pixels_clamped;
-ff_add_pixels_clamped = c->add_pixels_clamped;
-
 if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID)
 ff_xvid_idct_init(c, avctx);
 
@@ -307,6 +304,9 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, 
AVCodecContext *avctx)
 if (ARCH_X86)
 ff_idctdsp_init_x86(c, avctx, high_bit_depth);
 
+ff_put_pixels_clamped = c->put_pixels_clamped;
+ff_add_pixels_clamped = c->add_pixels_clamped;
+
 ff_init_scantable_permutation(c->idct_permutation,
   c->perm_type);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog