[FFmpeg-cvslog] avcodec/mjpegdec: Support some subsampled GBR variants

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
05:10:21 2014 +0100| [4243415741e335b92feb757d5514a2cdfbb63cc4] | committer: 
Michael Niedermayer

avcodec/mjpegdec: Support some subsampled  GBR variants

Fixes Ticket4045

Signed-off-by: Michael Niedermayer 

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

 libavcodec/mjpegdec.c |   30 +++---
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index b350f44..c4d4d8b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -492,15 +492,29 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 case 0x14121200:
 case 0x22211100:
 case 0x22112100:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? 
AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
-else
-goto unk_pixfmt;
-s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : 
AVCOL_RANGE_JPEG;
+if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && 
s->component_id[2] == 'A') {
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+else
+goto unk_pixfmt;
+s->upscale_v |= 3;
+} else {
+if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? 
AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+else
+goto unk_pixfmt;
+s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : 
AVCOL_RANGE_JPEG;
+}
 break;
 case 0x2100:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? 
AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
-else  s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
-s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : 
AVCOL_RANGE_JPEG;
+if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && 
s->component_id[2] == 'A') {
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+else
+goto unk_pixfmt;
+s->upscale_h |= 3;
+} else {
+if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? 
AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+else  s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
+s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : 
AVCOL_RANGE_JPEG;
+}
 break;
 case 0x22121100:
 case 0x22111200:
@@ -2094,6 +2108,7 @@ the_end:
avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P  ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P16||
+   avctx->pix_fmt == AV_PIX_FMT_GBRP ||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
   );
 avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
@@ -2132,6 +2147,7 @@ the_end:
avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P  ||
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
+   avctx->pix_fmt == AV_PIX_FMT_GBRP ||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
);
 avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);

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


[FFmpeg-cvslog] avformat/mp3dec: avoid seeking to negative positions

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
04:04:37 2014 +0100| [0b75b6c3cd2cb4775729bf019c25c4792a2729d4] | committer: 
Michael Niedermayer

avformat/mp3dec: avoid seeking to negative positions

Fixes Ticket4038

Signed-off-by: Michael Niedermayer 

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

 libavformat/mp3dec.c |4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 8208dbb..c4c1bb7 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -457,6 +457,10 @@ static int mp3_seek(AVFormatContext *s, int stream_index, 
int64_t timestamp,
 int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i);
 int64_t candidate = -1;
 int score = 999;
+
+if (pos < 0)
+continue;
+
 for(j=0; jhttp://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/internal: Add () to argument of FF_SIGNBIT() to ensure correct order or operations

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
03:42:40 2014 +0100| [9bb6e1175f6e396c9314449d62ee67b74081104e] | committer: 
Michael Niedermayer

avcodec/internal: Add () to argument of FF_SIGNBIT() to ensure correct order or 
operations

Signed-off-by: Michael Niedermayer 

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

 libavcodec/internal.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index b8ceb2e..f4e12e8 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -35,7 +35,7 @@
 
 #define FF_SANE_NB_CHANNELS 63U
 
-#define FF_SIGNBIT(x) (x >> CHAR_BIT * sizeof(x) - 1)
+#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
 
 #if HAVE_AVX
 #   define STRIDE_ALIGN 32

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


[FFmpeg-cvslog] mov: check ff_get_wav_header() return value

2014-11-17 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Nov 17 00:22:23 2014 +0100| [2007082d2db25f9305b8a345798b840ea7784fdb] | 
committer: Vittorio Giovara

mov: check ff_get_wav_header() return value

CC: libav-sta...@libav.org
Bug-Id: CID 717497

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

 libavformat/mov.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c22df1e..39e6883 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -647,9 +647,7 @@ static int mov_read_wfex(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 st = c->fc->streams[c->fc->nb_streams-1];
 
-ff_get_wav_header(pb, st->codec, atom.size);
-
-return 0;
+return ff_get_wav_header(pb, st->codec, atom.size);
 }
 
 static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)

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


[FFmpeg-cvslog] Merge commit '2007082d2db25f9305b8a345798b840ea7784fdb'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
03:33:35 2014 +0100| [4cd4a6de4f976a5bf79b564daa23c97cce545caf] | committer: 
Michael Niedermayer

Merge commit '2007082d2db25f9305b8a345798b840ea7784fdb'

* commit '2007082d2db25f9305b8a345798b840ea7784fdb':
  mov: check ff_get_wav_header() return value

Conflicts:
libavformat/mov.c

See: 6d55a40b00801899f7975b22401bdd96bbc228af
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] lavc: fix bitshifts amount bigger than the type

2014-11-17 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Nov 17 00:22:27 2014 +0100| [85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa] | 
committer: Vittorio Giovara

lavc: fix bitshifts amount bigger than the type

CC: libav-sta...@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638

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

 libavcodec/cavs.c |5 +++--
 libavcodec/cavsdec.c  |4 ++--
 libavcodec/dnxhdenc.c |2 +-
 libavcodec/internal.h |2 ++
 libavcodec/vp8.c  |4 ++--
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 2be50a7..788fcad 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -30,6 +30,7 @@
 #include "golomb.h"
 #include "h264chroma.h"
 #include "idctdsp.h"
+#include "internal.h"
 #include "mathops.h"
 #include "qpeldsp.h"
 #include "cavs.h"
@@ -529,8 +530,8 @@ static inline void scale_mv(AVSContext *h, int *d_x, int 
*d_y,
 {
 int den = h->scale_den[src->ref];
 
-*d_x = (src->x * distp * den + 256 + (src->x >> 31)) >> 9;
-*d_y = (src->y * distp * den + 256 + (src->y >> 31)) >> 9;
+*d_x = (src->x * distp * den + 256 + FF_SIGNBIT(src->x)) >> 9;
+*d_y = (src->y * distp * den + 256 + FF_SIGNBIT(src->y)) >> 9;
 }
 
 static inline void mv_pred_median(AVSContext *h,
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index d0c72a7..cf21a8b 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -473,7 +473,7 @@ static inline void mv_pred_direct(AVSContext *h, 
cavs_vector *pmv_fw,
 {
 cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
 int den = h->direct_den[col_mv->ref];
-int m = col_mv->x >> 31;
+int m = FF_SIGNBIT(col_mv->x);
 
 pmv_fw->dist = h->dist[1];
 pmv_bw->dist = h->dist[0];
@@ -482,7 +482,7 @@ static inline void mv_pred_direct(AVSContext *h, 
cavs_vector *pmv_fw,
 /* scale the co-located motion vector according to its temporal span */
 pmv_fw->x = (((den + (den * col_mv->x * pmv_fw->dist ^ m) - m - 1) >> 
14) ^ m) - m;
 pmv_bw->x = m - (((den + (den * col_mv->x * pmv_bw->dist ^ m) - m - 1) >> 
14) ^ m);
-m = col_mv->y >> 31;
+m = FF_SIGNBIT(col_mv->y);
 pmv_fw->y = (((den + (den * col_mv->y * pmv_fw->dist ^ m) - m - 1) >> 
14) ^ m) - m;
 pmv_bw->y = m - (((den + (den * col_mv->y * pmv_bw->dist ^ m) - m - 1) >> 
14) ^ m);
 }
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index c49ad7e..71eee9f 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -108,7 +108,7 @@ static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, 
int16_t *block,
 
 for (i = 1; i < 64; ++i) {
 int j = scantable[i];
-int sign = block[j] >> 31;
+int sign = FF_SIGNBIT(block[j]);
 int level = (block[j] ^ sign) - sign;
 level = level * qmat[j] >> DNX10BIT_QMAT_SHIFT;
 block[j] = (level ^ sign) - sign;
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 3b2ae40..a68d613 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -35,6 +35,8 @@
 
 #define FF_SANE_NB_CHANNELS 63U
 
+#define FF_SIGNBIT(x) (x >> CHAR_BIT * sizeof(x) - 1)
+
 typedef struct FramePool {
 /**
  * Pools for each data plane. For audio all the planes have the same size,
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index f437fee..9a12346 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1883,8 +1883,8 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, 
uint8_t *dst[3],
  mb->bmv[2 * y   * 4 + 2 * x + 1].y +
  mb->bmv[(2 * y + 1) * 4 + 2 * x].y +
  mb->bmv[(2 * y + 1) * 4 + 2 * x + 1].y;
-uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT - 1))) >> 2;
-uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT - 1))) >> 2;
+uvmv.x = (uvmv.x + 2 + FF_SIGNBIT(uvmv.x)) >> 2;
+uvmv.y = (uvmv.y + 2 + FF_SIGNBIT(uvmv.y)) >> 2;
 if (s->profile == 3) {
 uvmv.x &= ~7;
 uvmv.y &= ~7;

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


[FFmpeg-cvslog] Merge commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
03:16:38 2014 +0100| [cdbebae0bea97f300f256d722c1495753bc2] | committer: 
Michael Niedermayer

Merge commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa'

* commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa':
  lavc: fix bitshifts amount bigger than the type

Conflicts:
libavcodec/internal.h

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] libvpxenc: clean memory on error

2014-11-17 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Nov 17 00:22:28 2014 +0100| [771656bd85416cd6308b11aed6f2c69a8db9c21b] | 
committer: Vittorio Giovara

libvpxenc: clean memory on error

CC: libav-sta...@libav.org
Bug-Id: CID 733795

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

 libavcodec/libvpxenc.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 86e4be9..8ff7b28 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -470,6 +470,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket 
*pkt_out,
 av_log(avctx, AV_LOG_ERROR,
"Data buffer alloc (%zu bytes) failed\n",
cx_frame->sz);
+av_freep(&cx_frame);
 return AVERROR(ENOMEM);
 }
 memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);

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


[FFmpeg-cvslog] Merge commit '771656bd85416cd6308b11aed6f2c69a8db9c21b'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
03:08:20 2014 +0100| [8426edef4cf521104bb9288ac46a48dc4bdaee53] | committer: 
Michael Niedermayer

Merge commit '771656bd85416cd6308b11aed6f2c69a8db9c21b'

* commit '771656bd85416cd6308b11aed6f2c69a8db9c21b':
  libvpxenc: clean memory on error

Conflicts:
libavcodec/libvpxenc.c

See: 104b1d9e103f90485e894b20dd5bb3f1964fe5f3
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit 'a28468d0daf4be14761c16a3ddd33266b2380123'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
02:55:23 2014 +0100| [7384ec19cf13fe204317c1b88333c58cbfa6336a] | committer: 
Michael Niedermayer

Merge commit 'a28468d0daf4be14761c16a3ddd33266b2380123'

* commit 'a28468d0daf4be14761c16a3ddd33266b2380123':
  librtmp: append the correct field to the string

See: d1970929b5f8b873aac171586343c9d8142897ad
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] librtmp: append the correct field to the string

2014-11-17 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Mon 
Nov 17 00:22:22 2014 +0100| [a28468d0daf4be14761c16a3ddd33266b2380123] | 
committer: Vittorio Giovara

librtmp: append the correct field to the string

Also prevent a NULL pointer dereference.

CC: libav-sta...@libav.org
Bug-Id: CID 1250329 / CID 1250331

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

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

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 74e2c49..fac3a35 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -169,7 +169,7 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 }
 if (ctx->swfurl) {
 av_strlcat(filename, " swfUrl=", len);
-av_strlcat(filename, ctx->pageurl, len);
+av_strlcat(filename, ctx->swfurl, len);
 }
 if (ctx->flashver) {
 av_strlcat(filename, " flashVer=", len);

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


[FFmpeg-cvslog] lavf: Only initialize s-> offset once when using avoid_negative_ts make_zero

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Mon Nov 17 
13:31:47 2014 +0200| [9257692ac15eff7b07540c1f61cebde0d8823fbd] | committer: 
Martin Storsjö

lavf: Only initialize s->offset once when using avoid_negative_ts make_zero

When given a stream starting at dts=0, it would previously consider
s->offset as uninitialized and set an offset when the second packet
was written, ending up writing two packets with dts=0. By initializing
this field to AV_NOPTS_VALUE, we make sure that we only initialize it
once, on the first packet.

Signed-off-by: Martin Storsjö 

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

 libavformat/mux.c |4 ++--
 libavformat/options.c |1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 87220ec..9aee224 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -329,12 +329,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 AVRational time_base = s->streams[pkt->stream_index]->time_base;
 int64_t offset = 0;
 
-if (!s->offset && pkt->dts != AV_NOPTS_VALUE &&
+if (s->offset == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
 (pkt->dts < 0 || s->avoid_negative_ts == 
AVFMT_AVOID_NEG_TS_MAKE_ZERO)) {
 s->offset = -pkt->dts;
 s->offset_timebase = time_base;
 }
-if (s->offset)
+if (s->offset != AV_NOPTS_VALUE)
 offset = av_rescale_q(s->offset, s->offset_timebase, time_base);
 
 if (pkt->dts != AV_NOPTS_VALUE)
diff --git a/libavformat/options.c b/libavformat/options.c
index a5646df..ad47004 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -101,6 +101,7 @@ AVFormatContext *avformat_alloc_context(void)
 ic = av_malloc(sizeof(AVFormatContext));
 if (!ic) return ic;
 avformat_get_context_defaults(ic);
+ic->offset = AV_NOPTS_VALUE;
 
 ic->internal = av_mallocz(sizeof(*ic->internal));
 if (!ic->internal) {

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


[FFmpeg-cvslog] Merge commit '9257692ac15eff7b07540c1f61cebde0d8823fbd'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue Nov 18 
02:38:38 2014 +0100| [9943c5a42bdf8412f60e8a33489d6f2a8b1b9d61] | committer: 
Michael Niedermayer

Merge commit '9257692ac15eff7b07540c1f61cebde0d8823fbd'

* commit '9257692ac15eff7b07540c1f61cebde0d8823fbd':
  lavf: Only initialize s->offset once when using avoid_negative_ts make_zero

Conflicts:
libavformat/mux.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] avdevice/oss_audio: avoid strerror() and errbuf

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat Oct 18 
23:24:23 2014 +0200| [afbaa9a737b3546c12fdf328016cc1e587d65dc9] | committer: 
Michael Niedermayer

avdevice/oss_audio: avoid strerror() and errbuf

Signed-off-by: Michael Niedermayer 

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

 libavdevice/oss_audio.c |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index 4eb6a50..1f8b5e7 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -49,14 +49,13 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
 int audio_fd;
 int tmp, err;
 char *flip = getenv("AUDIO_FLIP_LEFT");
-char errbuff[128];
 
 if (is_output)
 audio_fd = avpriv_open(audio_device, O_WRONLY);
 else
 audio_fd = avpriv_open(audio_device, O_RDONLY);
 if (audio_fd < 0) {
-av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, strerror(errno));
+av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, 
av_err2str(AVERROR(errno)));
 return AVERROR(EIO);
 }
 
@@ -67,7 +66,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
 /* non blocking mode */
 if (!is_output) {
 if (fcntl(audio_fd, F_SETFL, O_NONBLOCK) < 0) {
-av_log(s1, AV_LOG_WARNING, "%s: Could not enable non block mode 
(%s)\n", audio_device, strerror(errno));
+av_log(s1, AV_LOG_WARNING, "%s: Could not enable non block mode 
(%s)\n", audio_device, av_err2str(AVERROR(errno)));
 }
 }
 
@@ -75,8 +74,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
 
 #define CHECK_IOCTL_ERROR(event)  \
 if (err < 0) {\
-av_strerror(AVERROR(errno), errbuff, sizeof(errbuff));\
-av_log(s1, AV_LOG_ERROR, #event ": %s\n", errbuff);   \
+av_log(s1, AV_LOG_ERROR, #event ": %s\n", av_err2str(AVERROR(errno)));\
 goto fail;\
 }
 
@@ -86,7 +84,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
  * fail anyway. */
 err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
 if (err < 0) {
-av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", 
strerror(errno));
+av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", 
av_err2str(AVERROR(errno)));
 }
 
 #if HAVE_BIGENDIAN

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


[FFmpeg-cvslog] tools: Add a sidxindex tool

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Wed Oct 29 
11:43:34 2014 +0200| [c302d034ba2690a935df8bf7e4f5d44ed86e8d5c] | committer: 
Martin Storsjö

tools: Add a sidxindex tool

This tool can write an MPD file for fragmented MP4 files with
a sidx index at the start of the file.

Signed-off-by: Martin Storsjö 

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

 libavformat/Makefile |1 +
 tools/sidxindex.c|  410 ++
 2 files changed, 411 insertions(+)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 7ed53a7..15f205a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -412,3 +412,4 @@ TOOLS = aviocat 
\
 ismindex\
 pktdumper   \
 probetest   \
+sidxindex   \
diff --git a/tools/sidxindex.c b/tools/sidxindex.c
new file mode 100644
index 000..da41d09
--- /dev/null
+++ b/tools/sidxindex.c
@@ -0,0 +1,410 @@
+/*
+ * Copyright (c) 2014 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+
+#include "libavformat/avformat.h"
+#include "libavutil/avstring.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mathematics.h"
+
+static int usage(const char *argv0, int ret)
+{
+fprintf(stderr, "%s -out foo.mpd file1\n", argv0);
+return ret;
+}
+
+struct Track {
+const char *name;
+int64_t duration;
+int bitrate;
+int track_id;
+int is_audio, is_video;
+int width, height;
+int sample_rate, channels;
+int timescale;
+char codec_str[30];
+int64_t sidx_start, sidx_length;
+int64_t  earliest_presentation;
+uint32_t earliest_presentation_timescale;
+};
+
+struct Tracks {
+int nb_tracks;
+int64_t duration;
+struct Track **tracks;
+int multiple_tracks_per_file;
+};
+
+static void set_codec_str(AVCodecContext *codec, char *str, int size)
+{
+switch (codec->codec_id) {
+case AV_CODEC_ID_H264:
+snprintf(str, size, "avc1");
+if (codec->extradata_size >= 4 && codec->extradata[0] == 1) {
+av_strlcatf(str, size, ".%02x%02x%02x",
+codec->extradata[1], codec->extradata[2], 
codec->extradata[3]);
+}
+break;
+case AV_CODEC_ID_AAC:
+snprintf(str, size, "mp4a.40"); // 0x40 is the mp4 object type for AAC
+if (codec->extradata_size >= 2) {
+int aot = codec->extradata[0] >> 3;
+if (aot == 31)
+aot = ((AV_RB16(codec->extradata) >> 5) & 0x3f) + 32;
+av_strlcatf(str, size, ".%d", aot);
+}
+break;
+}
+}
+
+static int find_sidx(struct Tracks *tracks, int start_index,
+ const char *file)
+{
+int err = 0;
+AVIOContext *f = NULL;
+int i;
+
+if ((err = avio_open2(&f, file, AVIO_FLAG_READ, NULL, NULL)) < 0)
+goto fail;
+
+while (!f->eof_reached) {
+int64_t pos = avio_tell(f);
+int32_t size, tag;
+
+size = avio_rb32(f);
+tag  = avio_rb32(f);
+if (size < 8)
+break;
+if (tag == MKBETAG('s', 'i', 'd', 'x')) {
+int version, track_id;
+uint32_t timescale;
+int64_t earliest_presentation;
+version = avio_r8(f);
+avio_rb24(f); /* flags */
+track_id = avio_rb32(f);
+timescale = avio_rb32(f);
+earliest_presentation = version ? avio_rb64(f) : avio_rb32(f);
+for (i = start_index; i < tracks->nb_tracks; i++) {
+struct Track *track = tracks->tracks[i];
+if (!track->sidx_start) {
+track->sidx_start  = pos;
+track->sidx_length = size;
+} else if (pos == track->sidx_start + track->sidx_length) {
+track->sidx_length = pos + size - track->sidx_start;
+}
+if (track->track_id == track_id) {
+

[FFmpeg-cvslog] Merge commit 'c302d034ba2690a935df8bf7e4f5d44ed86e8d5c'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
23:09:22 2014 +0100| [e60c025e7357fe45efc73c85310626a9e329d0d5] | committer: 
Michael Niedermayer

Merge commit 'c302d034ba2690a935df8bf7e4f5d44ed86e8d5c'

* commit 'c302d034ba2690a935df8bf7e4f5d44ed86e8d5c':
  tools: Add a sidxindex tool

Conflicts:
libavformat/Makefile

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] movenc: Allow writing a DASH sidx atom at the start of files

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Tue Oct 21 
11:42:27 2014 +0300| [40ed1cbf147d09fc0894bee160f0b6b6d9159fc5] | committer: 
Martin Storsjö

movenc: Allow writing a DASH sidx atom at the start of files

This is mapped to the faststart flag (which in this case
perhaps should be called "shift and write index at the
start of the file"), which for fragmented files will
write a sidx index at the start.

When segmenting DASH into files, there's usually one sidx
at the start of each segment (although it's not clear to me
whether that actually is necessary). When storing all of it
in one file, the MPD doesn't necessarily need to describe
the individual segments, but the offsets of the fragments can be
fetched from one large sidx atom at the start of the file. This
allows creating files for the DASH ISO BMFF on-demand profile.

Signed-off-by: Martin Storsjö 

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

 libavformat/movenc.c |  117 +++---
 libavformat/movenc.h |1 +
 2 files changed, 92 insertions(+), 26 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 27b6ef1..3ba1cc8 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2568,7 +2568,8 @@ static int mov_write_tfrf_tags(AVIOContext *pb, 
MOVMuxContext *mov,
 return 0;
 }
 
-static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int 
tracks)
+static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int 
tracks,
+int size)
 {
 int i;
 for (i = 0; i < mov->nb_streams; i++) {
@@ -2587,6 +2588,7 @@ static int mov_add_tfra_entries(AVIOContext *pb, 
MOVMuxContext *mov, int tracks)
 }
 info = &track->frag_info[track->nb_frag_info - 1];
 info->offset   = avio_tell(pb);
+info->size = size;
 // Try to recreate the original pts for the first packet
 // from the fields we have stored
 info->time = track->start_dts + track->frag_start +
@@ -2676,12 +2678,20 @@ static int mov_write_sidx_tag(AVIOContext *pb,
   MOVTrack *track, int ref_size, int 
total_sidx_size)
 {
 int64_t pos = avio_tell(pb), offset_pos, end_pos;
-int64_t presentation_time = track->start_dts + track->frag_start +
-track->cluster[0].cts;
-int64_t duration = track->start_dts + track->track_duration -
-   track->cluster[0].dts;
-int64_t offset;
-int starts_with_SAP = track->cluster[0].flags & MOV_SYNC_SAMPLE;
+int64_t presentation_time, duration, offset;
+int starts_with_SAP, i, entries;
+
+if (track->entry) {
+entries = 1;
+presentation_time = track->start_dts + track->frag_start +
+track->cluster[0].cts;
+duration = track->start_dts + track->track_duration -
+   track->cluster[0].dts;
+starts_with_SAP = track->cluster[0].flags & MOV_SYNC_SAMPLE;
+} else {
+entries = track->nb_frag_info;
+presentation_time = track->frag_info[0].time;
+}
 
 // pts<0 should be cut away using edts
 if (presentation_time < 0)
@@ -2697,10 +2707,21 @@ static int mov_write_sidx_tag(AVIOContext *pb,
 offset_pos = avio_tell(pb);
 avio_wb64(pb, 0); /* first_offset (offset to referenced moof) */
 avio_wb16(pb, 0); /* reserved */
-avio_wb16(pb, 1); /* reference_count */
-avio_wb32(pb, (0 << 31) | (ref_size & 0x7fff)); /* reference_type (0 = 
media) | referenced_size */
-avio_wb32(pb, duration); /* subsegment_duration */
-avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0); /* starts_with_SAP 
| SAP_type | SAP_delta_time */
+
+avio_wb16(pb, entries); /* reference_count */
+for (i = 0; i < entries; i++) {
+if (!track->entry) {
+if (i > 1 && track->frag_info[i].offset != track->frag_info[i - 
1].offset + track->frag_info[i - 1].size) {
+   av_log(NULL, AV_LOG_ERROR, "Non-consecutive fragments, writing 
incorrect sidx\n");
+}
+duration = track->frag_info[i].duration;
+ref_size = track->frag_info[i].size;
+starts_with_SAP = 1;
+}
+avio_wb32(pb, (0 << 31) | (ref_size & 0x7fff)); /* reference_type 
(0 = media) | referenced_size */
+avio_wb32(pb, duration); /* subsegment_duration */
+avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0); /* 
starts_with_SAP | SAP_type | SAP_delta_time */
+}
 
 end_pos = avio_tell(pb);
 offset = pos + total_sidx_size - end_pos;
@@ -2731,7 +2752,10 @@ static int mov_write_sidx_tags(AVIOContext *pb, 
MOVMuxContext *mov,
 MOVTrack *track = &mov->tracks[i];
 if (tracks >= 0 && i != tracks)
 continue;
-if (!track->entry)
+// When writing a sidx for the full file, entry is 0, but
+  

[FFmpeg-cvslog] Merge commit '40ed1cbf147d09fc0894bee160f0b6b6d9159fc5'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
23:02:02 2014 +0100| [4dc305d784ea01efd30871e9aa6625eff66e9e87] | committer: 
Michael Niedermayer

Merge commit '40ed1cbf147d09fc0894bee160f0b6b6d9159fc5'

* commit '40ed1cbf147d09fc0894bee160f0b6b6d9159fc5':
  movenc: Allow writing a DASH sidx atom at the start of files

Conflicts:
libavformat/movenc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit '3847f3ab58b3b74604807394247bf68827258103'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
22:23:48 2014 +0100| [3fa4351d6bea1b07a3dd71e2f61cef2af5130a7c] | committer: 
Michael Niedermayer

Merge commit '3847f3ab58b3b74604807394247bf68827258103'

* commit '3847f3ab58b3b74604807394247bf68827258103':
  movenc: Add tfra entries for all tracks in a moof

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] movenc: Add tfra entries for all tracks in a moof

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Sun Oct 12 
23:49:22 2014 +0300| [3847f3ab58b3b74604807394247bf68827258103] | committer: 
Martin Storsjö

movenc: Add tfra entries for all tracks in a moof

Previously only tfra entries were added for the first track in each moof.

The frag_info array used for tfra can also be used for writing
other kinds of fragment indexes, where it's more important to
include all tracks.

When the separate_moof option is enabled (as in ismv), we write
a separate moof for each track, so this doesn't make any difference
in that case.

Signed-off-by: Martin Storsjö 

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

 libavformat/movenc.c |4 
 1 file changed, 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7643967..27b6ef1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2600,10 +2600,6 @@ static int mov_add_tfra_entries(AVIOContext *pb, 
MOVMuxContext *mov, int tracks)
  track->cluster[0].dts;
 info->tfrf_offset = 0;
 mov_write_tfrf_tags(pb, mov, track);
-// If writing all tracks, we currently only add a tfra entry for
-// the first track (that actually has data to be written).
-if (tracks < 0)
-break;
 }
 return 0;
 }

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


[FFmpeg-cvslog] lavf: Add an MPEG-DASH ISOFF segmenting muxer

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Mon Oct  6 
11:36:17 2014 +0300| [fe5e6e34c05e274f98528be4f77f3c474473f977] | committer: 
Martin Storsjö

lavf: Add an MPEG-DASH ISOFF segmenting muxer

This is mostly to serve as a reference example on how to segment
the output from the mp4 muxer, capable of writing the segment
list in four different ways:
- SegmentTemplate with SegmentTimeline
- SegmentTemplate with implicit segments
- SegmentList with individual files
- SegmentList with one single file per track, and byte ranges

The muxer is able to serve live content (with optional windowing)
or create a static segmented MPD.

In advanced cases, users will probably want to do the segmenting
in their own application code.

Signed-off-by: Martin Storsjö 

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

 Changelog|2 +-
 configure|1 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |1 +
 libavformat/dashenc.c|  773 ++
 libavformat/version.h|4 +-
 6 files changed, 779 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index ecec401..6af2e8a 100644
--- a/Changelog
+++ b/Changelog
@@ -6,7 +6,7 @@ version :
 - HEVC/H.265 RTP payload format (draft v6) packetizer and depacketizer
 - avplay now exits by default at the end of playback
 - XCB-based screen-grabber
-- creating DASH compatible fragmented MP4
+- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
 
 
 version 11:
diff --git a/configure b/configure
index 766f9c2..4b0ef22 100755
--- a/configure
+++ b/configure
@@ -2039,6 +2039,7 @@ avi_muxer_select="riffenc"
 avisynth_demuxer_deps="avisynth"
 avisynth_demuxer_select="riffdec"
 caf_demuxer_select="riffdec"
+dash_muxer_select="mp4_muxer"
 dirac_demuxer_select="dirac_parser"
 dv_demuxer_select="dvprofile"
 dv_muxer_select="dvprofile"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index ff887f0..7ed53a7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -91,6 +91,7 @@ OBJS-$(CONFIG_CAVSVIDEO_MUXER)   += rawenc.o
 OBJS-$(CONFIG_CDG_DEMUXER)   += cdg.o
 OBJS-$(CONFIG_CDXL_DEMUXER)  += cdxl.o
 OBJS-$(CONFIG_CRC_MUXER) += crcenc.o
+OBJS-$(CONFIG_DASH_MUXER)+= dashenc.o isom.o
 OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
 OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
 OBJS-$(CONFIG_DFA_DEMUXER)   += dfa.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index bef155f..7868e3e 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -88,6 +88,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (CDG,  cdg);
 REGISTER_DEMUXER (CDXL, cdxl);
 REGISTER_MUXER   (CRC,  crc);
+REGISTER_MUXER   (DASH, dash);
 REGISTER_MUXDEMUX(DAUD, daud);
 REGISTER_DEMUXER (DFA,  dfa);
 REGISTER_MUXDEMUX(DIRAC,dirac);
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
new file mode 100644
index 000..cacaf92
--- /dev/null
+++ b/libavformat/dashenc.c
@@ -0,0 +1,773 @@
+/*
+ * MPEG-DASH ISO BMFF segmenter
+ * Copyright (c) 2014 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#if HAVE_UNISTD_H
+#include 
+#endif
+
+#include "libavutil/avstring.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
+#include "libavutil/time_internal.h"
+
+#include "avc.h"
+#include "avformat.h"
+#include "avio_internal.h"
+#include "internal.h"
+#include "isom.h"
+#include "os_support.h"
+#include "url.h"
+
+typedef struct Segment {
+char file[1024];
+int64_t start_pos;
+int range_length, index_length;
+int64_t time;
+int duration;
+int n;
+} Segment;
+
+typedef struct OutputStream {
+AVFormatContext *ctx;
+int ctx_inited;
+uint8_t iobuf[32768];
+URLContext *out;
+int packets_written;
+char initfile[1024];
+int64_t init_start_pos;
+int init_range_length;
+int nb_segments, segments_size, segment_index;
+Segment **segments;
+int64_t first

[FFmpeg-cvslog] Merge commit 'fe5e6e34c05e274f98528be4f77f3c474473f977'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
22:07:11 2014 +0100| [b5b15c4dd943fdb9fe57675a8926510be305223e] | committer: 
Michael Niedermayer

Merge commit 'fe5e6e34c05e274f98528be4f77f3c474473f977'

* commit 'fe5e6e34c05e274f98528be4f77f3c474473f977':
  lavf: Add an MPEG-DASH ISOFF segmenting muxer

Conflicts:
Changelog
libavformat/Makefile
libavformat/allformats.c
libavformat/version.h

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit '2ded57371abead879bcee56da5131e5fac0d17ef'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
21:55:23 2014 +0100| [9e0b0c60bd7fa4d4a476b93f94436a8e37d98983] | committer: 
Michael Niedermayer

Merge commit '2ded57371abead879bcee56da5131e5fac0d17ef'

* commit '2ded57371abead879bcee56da5131e5fac0d17ef':
  movenc: Add support for writing sidx atoms for DASH segments

Conflicts:
Changelog
libavformat/version.h

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] movenc: Add support for writing sidx atoms for DASH segments

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Sun Oct  5 
23:51:47 2014 +0300| [2ded57371abead879bcee56da5131e5fac0d17ef] | committer: 
Martin Storsjö

movenc: Add support for writing sidx atoms for DASH segments

A flag "dash" is added, which enables the necessary flags for
creating DASH compatible fragments.

When this is enabled, one sidx atom is written for each track
before every moof atom.

Signed-off-by: Martin Storsjö 

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

 Changelog |1 +
 libavformat/movenc.c  |   82 +++--
 libavformat/movenc.h  |1 +
 libavformat/version.h |2 +-
 4 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index c51fa8f..ecec401 100644
--- a/Changelog
+++ b/Changelog
@@ -6,6 +6,7 @@ version :
 - HEVC/H.265 RTP payload format (draft v6) packetizer and depacketizer
 - avplay now exits by default at the end of playback
 - XCB-based screen-grabber
+- creating DASH compatible fragmented MP4
 
 
 version 11:
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8d378c4..7643967 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -59,6 +59,7 @@ static const AVOption options[] = {
 { "omit_tfhd_offset", "Omit the base data offset in tfhd atoms", 0, 
AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_OMIT_TFHD_OFFSET}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 { "disable_chpl", "Disable Nero chapter atom", 0, AV_OPT_TYPE_CONST, {.i64 
= FF_MOV_FLAG_DISABLE_CHPL}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
"movflags" },
 { "default_base_moof", "Set the default-base-is-moof flag in tfhd atoms", 
0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_DEFAULT_BASE_MOOF}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
+{ "dash", "Write DASH compatible fragmented MP4", 0, AV_OPT_TYPE_CONST, 
{.i64 = FF_MOV_FLAG_DASH}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
"movflags" },
 FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
 { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, 
iods_skip), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
 { "iods_audio_profile", "iods audio profile atom.", 
offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 
255, AV_OPT_FLAG_ENCODING_PARAM},
@@ -2675,7 +2676,78 @@ static int mov_write_moof_tag_internal(AVIOContext *pb, 
MOVMuxContext *mov,
 return update_size(pb, pos);
 }
 
-static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks)
+static int mov_write_sidx_tag(AVIOContext *pb,
+  MOVTrack *track, int ref_size, int 
total_sidx_size)
+{
+int64_t pos = avio_tell(pb), offset_pos, end_pos;
+int64_t presentation_time = track->start_dts + track->frag_start +
+track->cluster[0].cts;
+int64_t duration = track->start_dts + track->track_duration -
+   track->cluster[0].dts;
+int64_t offset;
+int starts_with_SAP = track->cluster[0].flags & MOV_SYNC_SAMPLE;
+
+// pts<0 should be cut away using edts
+if (presentation_time < 0)
+presentation_time = 0;
+
+avio_wb32(pb, 0); /* size */
+ffio_wfourcc(pb, "sidx");
+avio_w8(pb, 1); /* version */
+avio_wb24(pb, 0);
+avio_wb32(pb, track->track_id); /* reference_ID */
+avio_wb32(pb, track->timescale); /* timescale */
+avio_wb64(pb, presentation_time); /* earliest_presentation_time */
+offset_pos = avio_tell(pb);
+avio_wb64(pb, 0); /* first_offset (offset to referenced moof) */
+avio_wb16(pb, 0); /* reserved */
+avio_wb16(pb, 1); /* reference_count */
+avio_wb32(pb, (0 << 31) | (ref_size & 0x7fff)); /* reference_type (0 = 
media) | referenced_size */
+avio_wb32(pb, duration); /* subsegment_duration */
+avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0); /* starts_with_SAP 
| SAP_type | SAP_delta_time */
+
+end_pos = avio_tell(pb);
+offset = pos + total_sidx_size - end_pos;
+avio_seek(pb, offset_pos, SEEK_SET);
+avio_wb64(pb, offset);
+avio_seek(pb, end_pos, SEEK_SET);
+return update_size(pb, pos);
+}
+
+static int mov_write_sidx_tags(AVIOContext *pb, MOVMuxContext *mov,
+   int tracks, int ref_size)
+{
+int i, round, ret;
+AVIOContext *avio_buf;
+int total_size = 0;
+for (round = 0; round < 2; round++) {
+// First run one round to calculate the total size of all
+// sidx atoms.
+// This would be much simpler if we'd only write one sidx
+// atom, for the first track in the moof.
+if (round == 0) {
+if ((ret = ffio_open_null_buf(&avio_buf)) < 0)
+return ret;
+} else {
+avio_buf = pb;
+}
+for (i = 0; i < mov->nb_streams; i++) {
+MOVTrack *track = &mov->tracks[i];
+if (track

[FFmpeg-cvslog] Merge commit '2d9d6afb8d2f284f5e620ecc19f643d5cd3facb8'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
21:43:31 2014 +0100| [1fddfaa282ff63dba4170ced30f96dbb48bd0246] | committer: 
Michael Niedermayer

Merge commit '2d9d6afb8d2f284f5e620ecc19f643d5cd3facb8'

* commit '2d9d6afb8d2f284f5e620ecc19f643d5cd3facb8':
  movenc: Factorize adding fragment info into a separate function

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] movenc: Factorize adding fragment info into a separate function

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Sun Oct 12 
23:37:17 2014 +0300| [2d9d6afb8d2f284f5e620ecc19f643d5cd3facb8] | committer: 
Martin Storsjö

movenc: Factorize adding fragment info into a separate function

By calling this after writing the moof the first time (for
calculating the moof size), we can avoid intermediate storage
of tfrf_offset in MOVTrack.

Signed-off-by: Martin Storsjö 

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

 libavformat/movenc.c |   77 --
 libavformat/movenc.h |1 -
 2 files changed, 49 insertions(+), 29 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 359716d..8d378c4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2567,6 +2567,46 @@ static int mov_write_tfrf_tags(AVIOContext *pb, 
MOVMuxContext *mov,
 return 0;
 }
 
+static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int 
tracks)
+{
+int i;
+for (i = 0; i < mov->nb_streams; i++) {
+MOVTrack *track = &mov->tracks[i];
+MOVFragmentInfo *info;
+if ((tracks >= 0 && i != tracks) || !track->entry)
+continue;
+track->nb_frag_info++;
+if (track->nb_frag_info >= track->frag_info_capacity) {
+unsigned new_capacity = track->nb_frag_info + 
MOV_FRAG_INFO_ALLOC_INCREMENT;
+if (av_reallocp_array(&track->frag_info,
+  new_capacity,
+  sizeof(*track->frag_info)))
+return AVERROR(ENOMEM);
+track->frag_info_capacity = new_capacity;
+}
+info = &track->frag_info[track->nb_frag_info - 1];
+info->offset   = avio_tell(pb);
+// Try to recreate the original pts for the first packet
+// from the fields we have stored
+info->time = track->start_dts + track->frag_start +
+ track->cluster[0].cts;
+// If the pts is less than zero, we will have trimmed
+// away parts of the media track using an edit list,
+// and the corresponding start presentation time is zero.
+if (info->time < 0)
+info->time = 0;
+info->duration = track->start_dts + track->track_duration -
+ track->cluster[0].dts;
+info->tfrf_offset = 0;
+mov_write_tfrf_tags(pb, mov, track);
+// If writing all tracks, we currently only add a tfra entry for
+// the first track (that actually has data to be written).
+if (tracks < 0)
+break;
+}
+return 0;
+}
+
 static int mov_write_tfdt_tag(AVIOContext *pb, MOVTrack *track)
 {
 int64_t pos = avio_tell(pb);
@@ -2597,7 +2637,11 @@ static int mov_write_traf_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 if (mov->ism_lookahead) {
 int i, size = 16 + 4 + 1 + 16 * mov->ism_lookahead;
 
-track->tfrf_offset = avio_tell(pb);
+if (track->nb_frag_info > 0) {
+MOVFragmentInfo *info = &track->frag_info[track->nb_frag_info 
- 1];
+if (!info->tfrf_offset)
+info->tfrf_offset = avio_tell(pb);
+}
 avio_wb32(pb, 8 + size);
 ffio_wfourcc(pb, "free");
 for (i = 0; i < size; i++)
@@ -2640,6 +2684,10 @@ static int mov_write_moof_tag(AVIOContext *pb, 
MOVMuxContext *mov, int tracks)
 return ret;
 mov_write_moof_tag_internal(avio_buf, mov, tracks, 0);
 moof_size = ffio_close_null_buf(avio_buf);
+
+if ((ret = mov_add_tfra_entries(pb, mov, tracks)) < 0)
+return ret;
+
 return mov_write_moof_tag_internal(pb, mov, tracks, moof_size);
 }
 
@@ -3004,36 +3052,9 @@ static int mov_flush_fragment(AVFormatContext *s)
 }
 
 if (write_moof) {
-MOVFragmentInfo *info;
 avio_flush(s->pb);
-track->nb_frag_info++;
-if (track->nb_frag_info >= track->frag_info_capacity) {
-unsigned new_capacity = track->nb_frag_info + 
MOV_FRAG_INFO_ALLOC_INCREMENT;
-if (av_reallocp_array(&track->frag_info,
-  new_capacity,
-  sizeof(*track->frag_info)))
-return AVERROR(ENOMEM);
-track->frag_info_capacity = new_capacity;
-}
-info = &track->frag_info[track->nb_frag_info - 1];
-info->offset   = avio_tell(s->pb);
-info->time = track->frag_start;
-if (track->entry) {
-// Try to recreate the original pts for the first packet
-// from the fields we have stored
-info->time = track->start_dts + track->frag_start +
- track->cluster[0].cts;
-// If the pts is less than zero, we will have trimmed
-// away parts of the media trac

[FFmpeg-cvslog] movenc: Include empty tracks in iods when writing fragmented mp4

2014-11-17 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Mon Nov  3 
23:44:02 2014 +0200| [0f9eb9165bb7d7982fdedf64f6bcec856f1bedd6] | committer: 
Martin Storsjö

movenc: Include empty tracks in iods when writing fragmented mp4

When writing fragmented streams with an empty initial moov,
we won't have any samples in any tracks when writing the
moov atom, thus trust that any tracks that are added actually
will be present.

Signed-off-by: Martin Storsjö 

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

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

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index fa5fdad..359716d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1809,7 +1809,7 @@ static int mov_write_iods_tag(AVIOContext *pb, 
MOVMuxContext *mov)
 int audio_profile = mov->iods_audio_profile;
 int video_profile = mov->iods_video_profile;
 for (i = 0; i < mov->nb_streams; i++) {
-if (mov->tracks[i].entry > 0) {
+if (mov->tracks[i].entry > 0 || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
 has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO;
 has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO;
 }

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


[FFmpeg-cvslog] Merge commit '0f9eb9165bb7d7982fdedf64f6bcec856f1bedd6'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
21:21:38 2014 +0100| [b96c1cd78b85ad53c44bca0ef16858be95593c79] | committer: 
Michael Niedermayer

Merge commit '0f9eb9165bb7d7982fdedf64f6bcec856f1bedd6'

* commit '0f9eb9165bb7d7982fdedf64f6bcec856f1bedd6':
  movenc: Include empty tracks in iods when writing fragmented mp4

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] avcodec/lcldec: support rgb24 with width%4 != 0

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
20:58:21 2014 +0100| [894d10332ca527ef91b29ad6eb52b73bdc95eb22] | committer: 
Michael Niedermayer

avcodec/lcldec: support rgb24 with width%4 != 0

Fixes Ticket1216

Signed-off-by: Michael Niedermayer 

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

 libavcodec/lcldec.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index ca62b42..1d94041 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -180,6 +180,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 int uqvq, ret;
 unsigned int mthread_inlen, mthread_outlen;
 unsigned int len = buf_size;
+int linesize;
 
 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
 return ret;
@@ -191,7 +192,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 case AV_CODEC_ID_MSZH:
 switch (c->compression) {
 case COMP_MSZH:
-if (c->imgtype == IMGTYPE_RGB24 && len == width * height * 3 ||
+if (c->imgtype == IMGTYPE_RGB24 && len == FFALIGN(width * 3, 4) * 
height ||
 c->imgtype == IMGTYPE_YUV111 && len == width * height * 3) {
 ;
 } else if (c->flags & FLAG_MULTITHREAD) {
@@ -411,10 +412,11 @@ static int decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame, AVPac
 }
 break;
 case IMGTYPE_RGB24:
+linesize = len < FFALIGN(3 * width, 4) * height ? 3 * width : 
FFALIGN(3 * width, 4);
 for (row = height - 1; row >= 0; row--) {
 pixel_ptr = row * frame->linesize[0];
 memcpy(outptr + pixel_ptr, encoded, 3 * width);
-encoded += 3 * width;
+encoded += linesize;
 }
 break;
 case IMGTYPE_YUV411:

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


[FFmpeg-cvslog] Read (display) aspect ratio from mxf files.

2014-11-17 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Mon Nov 17 
17:54:32 2014 +0100| [92c07acce736c64592c4c3232b4d0dacbe2f27f7] | committer: 
Carl Eugen Hoyos

Read (display) aspect ratio from mxf files.

Fixes ticket #4107.

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

 libavformat/avformat.h |7 +++
 libavformat/mxfdec.c   |2 ++
 libavformat/utils.c|5 +
 3 files changed, 14 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 56ab4e1..7b5de4f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1103,6 +1103,13 @@ typedef struct AVStream {
  * Keys are separated from values by '='.
  */
 char *recommended_encoder_configuration;
+
+/**
+ * display aspect ratio (0 if unknown)
+ * - encoding: unused
+ * - decoding: Set by libavformat to calculate sample_aspect_ratio 
internally
+ */
+AVRational display_aspect_ratio;
 } AVStream;
 
 AVRational av_stream_get_r_frame_rate(const AVStream *s);
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 87f1e51..fa0a2f4 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1781,6 +1781,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 if (source_track->sequence->origin) {
 av_dict_set_int(&st->metadata, "source_track_origin", 
source_track->sequence->origin, 0);
 }
+if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den)
+st->display_aspect_ratio = descriptor->aspect_ratio;
 } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
 container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, 
essence_container_ul);
 /* Only overwrite existing codec ID if it is unset or A-law, which 
is the default according to SMPTE RP 224. */
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 39851fc..6278668 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3347,6 +3347,11 @@ int avformat_find_stream_info(AVFormatContext *ic, 
AVDictionary **options)
 st->r_frame_rate.den = st->time_base.num;
 }
 }
+if (st->display_aspect_ratio.num && st->display_aspect_ratio.den) {
+AVRational hw_ratio = { st->codec->height, st->codec->width };
+st->sample_aspect_ratio = av_mul_q(st->display_aspect_ratio,
+   hw_ratio);
+}
 } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
 if (!st->codec->bits_per_coded_sample)
 st->codec->bits_per_coded_sample =

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


[FFmpeg-cvslog] mpcodecs: Use _INLINE guards for inline asm.

2014-11-17 Thread Matthew Oliver
ffmpeg | branch: master | Matthew Oliver  | Wed Nov  5 
17:26:15 2014 +1100| [70205f1799252c3363a5bb5ea7ea5df090f2c88f] | committer: 
Michael Niedermayer

mpcodecs: Use _INLINE guards for inline asm.

Enabled compilation with compiler without inline asm support.

Signed-off-by: Michael Niedermayer 

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

 libavfilter/libmpcodecs/vf_eq.c |4 ++--
 libavfilter/libmpcodecs/vf_eq2.c|4 ++--
 libavfilter/libmpcodecs/vf_fspp.c   |   32 
 libavfilter/libmpcodecs/vf_ilpack.c |4 ++--
 libavfilter/libmpcodecs/vf_pp7.c|8 
 libavfilter/libmpcodecs/vf_uspp.c   |6 +++---
 6 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/libavfilter/libmpcodecs/vf_eq.c b/libavfilter/libmpcodecs/vf_eq.c
index f8efa84..7be1674 100644
--- a/libavfilter/libmpcodecs/vf_eq.c
+++ b/libavfilter/libmpcodecs/vf_eq.c
@@ -37,7 +37,7 @@ struct vf_priv_s {
 int contrast;
 };
 
-#if HAVE_MMX && HAVE_6REGS
+#if HAVE_MMX_INLINE && HAVE_6REGS
 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, 
int sstride,
 int w, int h, int brightness, int contrast)
 {
@@ -224,7 +224,7 @@ static int vf_open(vf_instance_t *vf, char *args)
 if (args) sscanf(args, "%d:%d", &vf->priv->brightness, 
&vf->priv->contrast);
 
 process = process_C;
-#if HAVE_MMX && HAVE_6REGS
+#if HAVE_MMX_INLINE && HAVE_6REGS
 if(ff_gCpuCaps.hasMMX) process = process_MMX;
 #endif
 
diff --git a/libavfilter/libmpcodecs/vf_eq2.c b/libavfilter/libmpcodecs/vf_eq2.c
index 0356813..d0a2b92 100644
--- a/libavfilter/libmpcodecs/vf_eq2.c
+++ b/libavfilter/libmpcodecs/vf_eq2.c
@@ -120,7 +120,7 @@ void create_lut (eq2_param_t *par)
   par->lut_clean = 1;
 }
 
-#if HAVE_MMX && HAVE_6REGS
+#if HAVE_MMX_INLINE && HAVE_6REGS
 static
 void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
   unsigned w, unsigned h, unsigned dstride, unsigned sstride)
@@ -289,7 +289,7 @@ void check_values (eq2_param_t *par)
   if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
 par->adjust = NULL;
   }
-#if HAVE_MMX && HAVE_6REGS
+#if HAVE_MMX_INLINE && HAVE_6REGS
   else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) {
 par->adjust = &affine_1d_MMX;
   }
diff --git a/libavfilter/libmpcodecs/vf_fspp.c 
b/libavfilter/libmpcodecs/vf_fspp.c
index c4a36ef..d457859 100644
--- a/libavfilter/libmpcodecs/vf_fspp.c
+++ b/libavfilter/libmpcodecs/vf_fspp.c
@@ -101,7 +101,7 @@ struct vf_priv_s { //align 16 !
 };
 
 
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
 
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int 
src_stride, int width, int height, int log2_scale)
@@ -177,7 +177,7 @@ static void row_fdct_c(int16_t *data, const uint8_t 
*pixels, int line_size, int
 #define row_idct_s row_idct_c
 #define row_fdct_s row_fdct_c
 
-#else /* HAVE_MMX */
+#else /* HAVE_MMX_INLINE */
 
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long 
src_stride, long width, long height, long log2_scale)
@@ -404,7 +404,7 @@ static void row_fdct_mmx(int16_t *data,  const uint8_t 
*pixels,  int line_size,
 #define column_fidct_s column_fidct_mmx
 #define row_idct_s row_idct_mmx
 #define row_fdct_s row_fdct_mmx
-#endif // HAVE_MMX
+#endif // HAVE_MMX_INLINE
 
 static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src,
int dst_stride, int src_stride,
@@ -563,10 +563,10 @@ static int put_image(struct vf_instance *vf, mp_image_t 
*mpi, double pts)
 }
 }
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 if(ff_gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
 if(ff_gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 return ff_vf_next_put_image(vf,dmpi, pts);
@@ -707,7 +707,7 @@ const vf_info_t ff_vf_info_fspp = {
 #define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
 #define DESCALE(x,n)  (((x) + (1 << ((n)-1))) >> n)
 
-#if HAVE_MMX
+#if HAVE_MMX_INLINE
 
 DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)=FIX64(0.382683433, 14);
 DECLARE_ALIGNED(8, uint64_t, ff_MM_FIX_0_541196100)=FIX64(0.541196100, 14);
@@ -728,7 +728,7 @@ DECLARE_ASM_CONST(8, uint64_t, 
MM_FIX_0_198912367)=FIX64(0.198912367, 14);
 DECLARE_ASM_CONST(8, uint64_t, MM_DESCALE_RND)=C64(4);
 DECLARE_ASM_CONST(8, uint64_t, MM_2)=C64(2);
 
-#else /* !HAVE_MMX */
+#else /* !HAVE_MMX_INLINE */
 
 typedef int32_t int_simd16_t;
 static const int16_t FIX_0_382683433=FIX(0.382683433, 14);
@@ -743,7 +743,7 @@ static const int16_t FIX_1_082392200=FIX(1.082392200, 13);
 
 #endif
 
-#if !HAVE_MMX
+#if !HAVE_MMX_INLINE
 
 static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, 
int cnt)
 {
@@ -868,7 +868,7 @@ static void column_fidct_c(int16_t* thr_adr, 

[FFmpeg-cvslog] configure: Enable mpcodec compilation without inline asm.

2014-11-17 Thread Matthew Oliver
ffmpeg | branch: master | Matthew Oliver  | Mon Nov 17 
21:03:13 2014 +1100| [0b3c23054279fe49ed550735a34cfbed67ce68cd] | committer: 
Michael Niedermayer

configure: Enable mpcodec compilation without inline asm.

Signed-off-by: Michael Niedermayer 

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

 configure |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 883c043..563b311 100755
--- a/configure
+++ b/configure
@@ -2577,7 +2577,7 @@ ladspa_filter_deps="ladspa dlopen"
 ladspa_filter_extralibs='$ldl'
 mcdeint_filter_deps="avcodec gpl"
 movie_filter_deps="avcodec avformat"
-mp_filter_deps="gpl avcodec swscale inline_asm"
+mp_filter_deps="gpl avcodec swscale"
 mpdecimate_filter_deps="gpl"
 mpdecimate_filter_select="pixelutils"
 mptestsrc_filter_deps="gpl"

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


[FFmpeg-cvslog] avformat/flvenc: remove unused variable

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
13:08:05 2014 +0100| [cc5f7315413251b25cf765a2ada4edea94c0309b] | committer: 
Michael Niedermayer

avformat/flvenc: remove unused variable

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 4749fb4..a8cd994 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -200,7 +200,7 @@ static void write_metadata(AVFormatContext *s, unsigned int 
ts)
 {
 AVIOContext *pb = s->pb;
 FLVContext *flv = s->priv_data;
-int i, metadata_count = 0;
+int metadata_count = 0;
 int64_t metadata_size_pos, data_size, metadata_count_pos;
 AVDictionaryEntry *tag = NULL;
 

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


[FFmpeg-cvslog] flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.

2014-11-17 Thread Andrew Stone
ffmpeg | branch: master | Andrew Stone  | Fri Nov  7 
16:09:10 2014 -0500| [c64f3615118d757dcf76040fe5407bf2b3883206] | committer: 
Anton Khirnov

flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.

Signed-off-by: Anton Khirnov 

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

 libavformat/flvenc.c |   33 +++--
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 7cb1f61..9f39fa7 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -192,7 +192,7 @@ static void put_amf_bool(AVIOContext *pb, int b)
 avio_w8(pb, !!b);
 }
 
-static void write_metadata(AVFormatContext *s)
+static void write_metadata(AVFormatContext *s, unsigned int ts)
 {
 AVIOContext *pb = s->pb;
 FLVContext *flv = s->priv_data;
@@ -204,7 +204,7 @@ static void write_metadata(AVFormatContext *s)
 avio_w8(pb, 18);// tag type META
 metadata_size_pos = avio_tell(pb);
 avio_wb24(pb, 0);   // size of data part (sum of all parts below)
-avio_wb24(pb, 0);   // timestamp
+avio_wb24(pb, ts);  // timestamp
 avio_wb32(pb, 0);   // reserved
 
 /* now data of data_size size */
@@ -373,7 +373,7 @@ static int flv_write_header(AVFormatContext *s)
 flv->reserved = 5;
 }
 
-write_metadata(s);
+write_metadata(s, 0);
 
 for (i = 0; i < s->nb_streams; i++) {
 AVCodecContext *enc = s->streams[i]->codec;
@@ -459,6 +459,22 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 else
 flags_size = 1;
 
+if (flv->delay == AV_NOPTS_VALUE)
+flv->delay = -pkt->dts;
+
+if (pkt->dts < -flv->delay) {
+av_log(s, AV_LOG_WARNING,
+   "Packets are not in the proper order with respect to DTS\n");
+return AVERROR(EINVAL);
+}
+
+ts = pkt->dts + flv->delay; // add delay to force positive dts
+
+if (s->event_flags & AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
+write_metadata(s, ts);
+s->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
+}
+
 switch (enc->codec_type) {
 case AVMEDIA_TYPE_VIDEO:
 avio_w8(pb, FLV_TAG_TYPE_VIDEO);
@@ -493,17 +509,6 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
 return -1;
 
-if (flv->delay == AV_NOPTS_VALUE)
-flv->delay = -pkt->dts;
-
-if (pkt->dts < -flv->delay) {
-av_log(s, AV_LOG_WARNING,
-   "Packets are not in the proper order with respect to DTS\n");
-return AVERROR(EINVAL);
-}
-
-ts = pkt->dts + flv->delay; // add delay to force positive dts
-
 /* check Speex packet duration */
 if (enc->codec_id == AV_CODEC_ID_SPEEX && ts - sc->last_ts > 160)
 av_log(s, AV_LOG_WARNING, "Warning: Speex stream has more than "

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


[FFmpeg-cvslog] Merge commit 'c64f3615118d757dcf76040fe5407bf2b3883206'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
13:00:10 2014 +0100| [4127d97c8de6a1246d4414799f6aa4d8a45e2243] | committer: 
Michael Niedermayer

Merge commit 'c64f3615118d757dcf76040fe5407bf2b3883206'

* commit 'c64f3615118d757dcf76040fe5407bf2b3883206':
  flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit '4d0cd5f58c892276716f46f4b2702915e5018215'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
12:43:55 2014 +0100| [bb7be3b763d37c1e869431a76da7a8a2ddf1d9f9] | committer: 
Michael Niedermayer

Merge commit '4d0cd5f58c892276716f46f4b2702915e5018215'

* commit '4d0cd5f58c892276716f46f4b2702915e5018215':
  flvenc: move metadata updates into a single function

Conflicts:
libavformat/flvenc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] flvenc: move metadata updates into a single function

2014-11-17 Thread Andrew Stone
ffmpeg | branch: master | Andrew Stone  | Fri Nov  7 
16:09:09 2014 -0500| [4d0cd5f58c892276716f46f4b2702915e5018215] | committer: 
Anton Khirnov

flvenc: move metadata updates into a single function

Signed-off-by: Anton Khirnov 

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

 libavformat/flvenc.c |  193 +++---
 1 file changed, 103 insertions(+), 90 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index cc4c782..7cb1f61 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -60,6 +60,11 @@ typedef struct FLVContext {
 int64_t filesize_offset;
 int64_t duration;
 int64_t delay;  ///< first dts delay (needed for AVC & Speex)
+
+AVCodecContext *audio_enc;
+AVCodecContext *video_enc;
+double framerate;
+AVCodecContext *data_enc;
 } FLVContext;
 
 typedef struct FLVStreamContext {
@@ -187,85 +192,14 @@ static void put_amf_bool(AVIOContext *pb, int b)
 avio_w8(pb, !!b);
 }
 
-static int flv_write_header(AVFormatContext *s)
+static void write_metadata(AVFormatContext *s)
 {
 AVIOContext *pb = s->pb;
 FLVContext *flv = s->priv_data;
-AVCodecContext *audio_enc = NULL, *video_enc = NULL, *data_enc = NULL;
 int i, metadata_count = 0;
-double framerate = 0.0;
 int64_t metadata_size_pos, data_size, metadata_count_pos;
 AVDictionaryEntry *tag = NULL;
 
-for (i = 0; i < s->nb_streams; i++) {
-AVCodecContext *enc = s->streams[i]->codec;
-FLVStreamContext *sc;
-switch (enc->codec_type) {
-case AVMEDIA_TYPE_VIDEO:
-if (s->streams[i]->avg_frame_rate.den &&
-s->streams[i]->avg_frame_rate.num) {
-framerate = av_q2d(s->streams[i]->avg_frame_rate);
-}
-if (video_enc) {
-av_log(s, AV_LOG_ERROR,
-   "at most one video stream is supported in flv\n");
-return AVERROR(EINVAL);
-}
-video_enc = enc;
-if (enc->codec_tag == 0) {
-av_log(s, AV_LOG_ERROR, "video codec not compatible with 
flv\n");
-return -1;
-}
-break;
-case AVMEDIA_TYPE_AUDIO:
-if (audio_enc) {
-av_log(s, AV_LOG_ERROR,
-   "at most one audio stream is supported in flv\n");
-return AVERROR(EINVAL);
-}
-audio_enc = enc;
-if (get_audio_flags(s, enc) < 0)
-return AVERROR_INVALIDDATA;
-break;
-case AVMEDIA_TYPE_DATA:
-if (enc->codec_id != AV_CODEC_ID_TEXT) {
-av_log(s, AV_LOG_ERROR, "codec not compatible with flv\n");
-return AVERROR_INVALIDDATA;
-}
-data_enc = enc;
-break;
-default:
-av_log(s, AV_LOG_ERROR, "codec not compatible with flv\n");
-return -1;
-}
-avpriv_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
-
-sc = av_mallocz(sizeof(FLVStreamContext));
-if (!sc)
-return AVERROR(ENOMEM);
-s->streams[i]->priv_data = sc;
-sc->last_ts = -1;
-}
-
-flv->delay = AV_NOPTS_VALUE;
-
-avio_write(pb, "FLV", 3);
-avio_w8(pb, 1);
-avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!audio_enc +
-FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
-avio_wb32(pb, 9);
-avio_wb32(pb, 0);
-
-for (i = 0; i < s->nb_streams; i++)
-if (s->streams[i]->codec->codec_tag == 5) {
-avio_w8(pb, 8); // message type
-avio_wb24(pb, 0);   // include flags
-avio_wb24(pb, 0);   // time stamp
-avio_wb32(pb, 0);   // reserved
-avio_wb32(pb, 11);  // size
-flv->reserved = 5;
-}
-
 /* write meta_tag */
 avio_w8(pb, 18);// tag type META
 metadata_size_pos = avio_tell(pb);
@@ -282,57 +216,57 @@ static int flv_write_header(AVFormatContext *s)
 /* mixed array (hash) with size and string/type/data tuples */
 avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
 metadata_count_pos = avio_tell(pb);
-metadata_count = 4 * !!video_enc +
- 5 * !!audio_enc +
- 1 * !!data_enc  +
+metadata_count = 4 * !!flv->video_enc +
+ 5 * !!flv->audio_enc +
+ 1 * !!flv->data_enc  +
  2; // +2 for duration and file size
 
 avio_wb32(pb, metadata_count);
 
 put_amf_string(pb, "duration");
-flv->duration_offset= avio_tell(pb);
+flv->duration_offset = avio_tell(pb);
 
 // fill in the guessed duration, it'll be corrected later if incorrect
 put_amf_double(pb, s->duration / AV_TIME_BASE);
 
-if (video_enc) {
+if (flv->video_enc) {
 put_amf_string(pb, "width");
-put_amf_double(pb, video_

[FFmpeg-cvslog] Merge commit '8b573ddda75980f724f779ff75aacc2ff81d9e0e'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
12:24:38 2014 +0100| [c88ae843da4a9589a6ef1138fb9d9aaa28add2d3] | committer: 
Michael Niedermayer

Merge commit '8b573ddda75980f724f779ff75aacc2ff81d9e0e'

* commit '8b573ddda75980f724f779ff75aacc2ff81d9e0e':
  hevc: remove superfluous assignments and checks

Conflicts:
libavcodec/hevc.c

See: 83976e40e89655162e5394cf8915d9b6d89702d9
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevc: remove superfluous assignments and checks

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Nov 16 
08:23:19 2014 +0100| [8b573ddda75980f724f779ff75aacc2ff81d9e0e] | committer: 
Anton Khirnov

hevc: remove superfluous assignments and checks

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

 libavcodec/hevc.c |8 
 1 file changed, 8 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 539112b..3dcbe60 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1766,9 +1766,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
 DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
 
-if (!ref1)
-return;
-
 luma_mc(s, tmp, tmpstride, ref1->frame,
 ¤t_mv.mv[1], x0, y0, nPbW, nPbH);
 
@@ -1805,11 +1802,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
 DECLARE_ALIGNED(16, int16_t, tmp3[MAX_PB_SIZE * MAX_PB_SIZE]);
 DECLARE_ALIGNED(16, int16_t, tmp4[MAX_PB_SIZE * MAX_PB_SIZE]);
-HEVCFrame *ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
-HEVCFrame *ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
-
-if (!ref0 || !ref1)
-return;
 
 luma_mc(s, tmp, tmpstride, ref0->frame,
 ¤t_mv.mv[0], x0, y0, nPbW, nPbH);

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


[FFmpeg-cvslog] hevc: eliminate an unneeded intermediate variable

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Nov 16 
08:15:42 2014 +0100| [eac3ac1fe0774b65316852616b2672702dbc3f31] | committer: 
Anton Khirnov

hevc: eliminate an unneeded intermediate variable

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

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

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 61ba0f0..539112b 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1647,7 +1647,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 int min_cb_width = s->sps->min_cb_width;
 int x_cb = x0 >> log2_min_cb_size;
 int y_cb = y0 >> log2_min_cb_size;
-int ref_idx[2];
 int x_pu, y_pu;
 int i, j;
 
@@ -1674,8 +1673,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 
 if (inter_pred_idc != PRED_L1) {
 if (s->sh.nb_refs[L0]) {
-ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]);
-current_mv.ref_idx[0] = ref_idx[0];
+current_mv.ref_idx[0]= ff_hevc_ref_idx_lx_decode(s, 
s->sh.nb_refs[L0]);
 }
 current_mv.pred_flag[0] = 1;
 hls_mvd_coding(s, x0, y0, 0);
@@ -1689,8 +1687,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 
 if (inter_pred_idc != PRED_L0) {
 if (s->sh.nb_refs[L1]) {
-ref_idx[1] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L1]);
-current_mv.ref_idx[1] = ref_idx[1];
+current_mv.ref_idx[1]= ff_hevc_ref_idx_lx_decode(s, 
s->sh.nb_refs[L1]);
 }
 
 if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) {

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


[FFmpeg-cvslog] Merge commit 'eac3ac1fe0774b65316852616b2672702dbc3f31'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
12:12:55 2014 +0100| [91a9ae5b6bbfba611393eca1694417e6329f9bf3] | committer: 
Michael Niedermayer

Merge commit 'eac3ac1fe0774b65316852616b2672702dbc3f31'

* commit 'eac3ac1fe0774b65316852616b2672702dbc3f31':
  hevc: eliminate an unneeded intermediate variable

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit 'eb335f3c5ce37f2b93c993e28404d113bee843bc'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
12:07:49 2014 +0100| [0d5af820f7be073963f270e4387938f199e1facf] | committer: 
Michael Niedermayer

Merge commit 'eb335f3c5ce37f2b93c993e28404d113bee843bc'

* commit 'eb335f3c5ce37f2b93c993e28404d113bee843bc':
  hevc: reduce variable scope

Conflicts:
libavcodec/hevc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevc: reduce variable scope

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Nov 16 
08:13:46 2014 +0100| [eb335f3c5ce37f2b93c993e28404d113bee843bc] | committer: 
Anton Khirnov

hevc: reduce variable scope

Also, collapse the array into a scalar, since only one value is needed
at a time.

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

 libavcodec/hevc.c |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 2cbb35f..61ba0f0 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1648,7 +1648,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 int x_cb = x0 >> log2_min_cb_size;
 int y_cb = y0 >> log2_min_cb_size;
 int ref_idx[2];
-int mvp_flag[2];
 int x_pu, y_pu;
 int i, j;
 
@@ -1667,6 +1666,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
partIdx, merge_idx, ¤t_mv);
 } else {
 enum InterPredIdc inter_pred_idc = PRED_L0;
+int mvp_flag;
+
 ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
 if (s->sh.slice_type == B_SLICE)
 inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
@@ -1678,10 +1679,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 }
 current_mv.pred_flag[0] = 1;
 hls_mvd_coding(s, x0, y0, 0);
-mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
+mvp_flag = ff_hevc_mvp_lx_flag_decode(s);
 ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
  partIdx, merge_idx, ¤t_mv,
- mvp_flag[0], 0);
+ mvp_flag, 0);
 current_mv.mv[0].x += lc->pu.mvd.x;
 current_mv.mv[0].y += lc->pu.mvd.y;
 }
@@ -1699,10 +1700,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 }
 
 current_mv.pred_flag[1] = 1;
-mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
+mvp_flag = ff_hevc_mvp_lx_flag_decode(s);
 ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
  partIdx, merge_idx, ¤t_mv,
- mvp_flag[1], 1);
+ mvp_flag, 1);
 current_mv.mv[1].x += lc->pu.mvd.x;
 current_mv.mv[1].y += lc->pu.mvd.y;
 }

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


[FFmpeg-cvslog] hevc: further reduce code duplication in hls_prediction_unit()

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Nov 16 
08:06:27 2014 +0100| [84c0ece5fd9569c0f31804f02a199ecd0e7d13d8] | committer: 
Anton Khirnov

hevc: further reduce code duplication in hls_prediction_unit()

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

 libavcodec/hevc.c |   18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 674d64c..2cbb35f 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1665,12 +1665,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 
 ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
partIdx, merge_idx, ¤t_mv);
-x_pu = x0 >> s->sps->log2_min_pu_size;
-y_pu = y0 >> s->sps->log2_min_pu_size;
-
-for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
 } else {
 enum InterPredIdc inter_pred_idc = PRED_L0;
 ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
@@ -1712,14 +1706,14 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 current_mv.mv[1].x += lc->pu.mvd.x;
 current_mv.mv[1].y += lc->pu.mvd.y;
 }
+}
 
-x_pu = x0 >> s->sps->log2_min_pu_size;
-y_pu = y0 >> s->sps->log2_min_pu_size;
+x_pu = x0 >> s->sps->log2_min_pu_size;
+y_pu = y0 >> s->sps->log2_min_pu_size;
 
-for(j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-}
+for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
+for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
+tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
 
 if (current_mv.pred_flag[0]) {
 ref0 = refPicList[0].ref[current_mv.ref_idx[0]];

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


[FFmpeg-cvslog] Merge commit '84c0ece5fd9569c0f31804f02a199ecd0e7d13d8'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
12:01:47 2014 +0100| [c23d7de22ec0c14ad35d40c9073451c64a5ce74d] | committer: 
Michael Niedermayer

Merge commit '84c0ece5fd9569c0f31804f02a199ecd0e7d13d8'

* commit '84c0ece5fd9569c0f31804f02a199ecd0e7d13d8':
  hevc: further reduce code duplication in hls_prediction_unit()

Conflicts:
libavcodec/hevc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit 'a7b365ae191f45a0d7ed7b34033d5d0cbdd47139'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:54:41 2014 +0100| [e078549421b2845799abe878fc2a60ec89399fcc] | committer: 
Michael Niedermayer

Merge commit 'a7b365ae191f45a0d7ed7b34033d5d0cbdd47139'

* commit 'a7b365ae191f45a0d7ed7b34033d5d0cbdd47139':
  hevc: reduce code duplication in hls_prediction_unit()

Conflicts:
libavcodec/hevc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevc: reduce code duplication in hls_prediction_unit()

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Nov 16 
08:02:18 2014 +0100| [a7b365ae191f45a0d7ed7b34033d5d0cbdd47139] | committer: 
Anton Khirnov

hevc: reduce code duplication in hls_prediction_unit()

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

 libavcodec/hevc.c |  117 +++--
 1 file changed, 51 insertions(+), 66 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index e4e0b4b..674d64c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1652,88 +1652,73 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 int x_pu, y_pu;
 int i, j;
 
-if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) {
+int skip_flag = SAMPLE_CTB(s->skip_flag, x_cb, y_cb);
+
+if (!skip_flag)
+lc->pu.merge_flag = ff_hevc_merge_flag_decode(s);
+
+if (skip_flag || lc->pu.merge_flag) {
 if (s->sh.max_num_merge_cand > 1)
 merge_idx = ff_hevc_merge_idx_decode(s);
 else
 merge_idx = 0;
 
-ff_hevc_luma_mv_merge_mode(s, x0, y0,
-   1 << log2_cb_size,
-   1 << log2_cb_size,
-   log2_cb_size, partIdx,
-   merge_idx, ¤t_mv);
+ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
+   partIdx, merge_idx, ¤t_mv);
 x_pu = x0 >> s->sps->log2_min_pu_size;
 y_pu = y0 >> s->sps->log2_min_pu_size;
 
 for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
 for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
 tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-} else { /* MODE_INTER */
-lc->pu.merge_flag = ff_hevc_merge_flag_decode(s);
-if (lc->pu.merge_flag) {
-if (s->sh.max_num_merge_cand > 1)
-merge_idx = ff_hevc_merge_idx_decode(s);
-else
-merge_idx = 0;
-
-ff_hevc_luma_mv_merge_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
-   partIdx, merge_idx, ¤t_mv);
-x_pu = x0 >> s->sps->log2_min_pu_size;
-y_pu = y0 >> s->sps->log2_min_pu_size;
-
-for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
-for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
-tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
-} else {
-enum InterPredIdc inter_pred_idc = PRED_L0;
-ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
-if (s->sh.slice_type == B_SLICE)
-inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
-
-if (inter_pred_idc != PRED_L1) {
-if (s->sh.nb_refs[L0]) {
-ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, 
s->sh.nb_refs[L0]);
-current_mv.ref_idx[0] = ref_idx[0];
-}
-current_mv.pred_flag[0] = 1;
-hls_mvd_coding(s, x0, y0, 0);
-mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
-ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
- partIdx, merge_idx, ¤t_mv,
- mvp_flag[0], 0);
-current_mv.mv[0].x += lc->pu.mvd.x;
-current_mv.mv[0].y += lc->pu.mvd.y;
+} else {
+enum InterPredIdc inter_pred_idc = PRED_L0;
+ff_hevc_set_neighbour_available(s, x0, y0, nPbW, nPbH);
+if (s->sh.slice_type == B_SLICE)
+inter_pred_idc = ff_hevc_inter_pred_idc_decode(s, nPbW, nPbH);
+
+if (inter_pred_idc != PRED_L1) {
+if (s->sh.nb_refs[L0]) {
+ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]);
+current_mv.ref_idx[0] = ref_idx[0];
 }
-
-if (inter_pred_idc != PRED_L0) {
-if (s->sh.nb_refs[L1]) {
-ref_idx[1] = ff_hevc_ref_idx_lx_decode(s, 
s->sh.nb_refs[L1]);
-current_mv.ref_idx[1] = ref_idx[1];
-}
-
-if (s->sh.mvd_l1_zero_flag == 1 && inter_pred_idc == PRED_BI) {
-AV_ZERO32(&lc->pu.mvd);
-} else {
-hls_mvd_coding(s, x0, y0, 1);
-}
-
-current_mv.pred_flag[1] = 1;
-mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
-ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
- partIdx, merge_idx, ¤t_mv,
- mvp_flag[1], 1);
-current_mv.mv[1].x += lc->pu.mvd.x;
-current_mv.mv[1].y += lc->pu.mvd.y;
+current_mv.pred_flag[0] = 1;
+hls_mvd_coding(s, x0, y0, 0);
+   

[FFmpeg-cvslog] Merge commit 'de1f8ead8993512925a3ee6c7491473414419e55'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:41:35 2014 +0100| [30156eab6d816878bb404fb1565d026aad0d2d9e] | committer: 
Michael Niedermayer

Merge commit 'de1f8ead8993512925a3ee6c7491473414419e55'

* commit 'de1f8ead8993512925a3ee6c7491473414419e55':
  hevcdsp_template: templatize transquant_bypass

Conflicts:
libavcodec/hevcdsp_template.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevcdsp_template: templatize transquant_bypass

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Nov 15 
22:31:27 2014 +0100| [de1f8ead8993512925a3ee6c7491473414419e55] | committer: 
Anton Khirnov

hevcdsp_template: templatize transquant_bypass

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

 libavcodec/hevcdsp_template.c |   53 ++---
 1 file changed, 13 insertions(+), 40 deletions(-)

diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 8dcc83d..ae7e021 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -40,16 +40,16 @@ static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, 
int size,
 }
 }
 
-static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
-   ptrdiff_t stride)
+static av_always_inline void FUNC(transquant_bypass)(uint8_t *_dst, int16_t 
*coeffs,
+ ptrdiff_t stride, int 
size)
 {
 int x, y;
 pixel *dst = (pixel *)_dst;
 
 stride /= sizeof(pixel);
 
-for (y = 0; y < 4; y++) {
-for (x = 0; x < 4; x++) {
+for (y = 0; y < size; y++) {
+for (x = 0; x < size; x++) {
 dst[x] = av_clip_pixel(dst[x] + *coeffs);
 coeffs++;
 }
@@ -57,55 +57,28 @@ static void FUNC(transquant_bypass4x4)(uint8_t *_dst, 
int16_t *coeffs,
 }
 }
 
-static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs,
+static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride)
 {
-int x, y;
-pixel *dst = (pixel *)_dst;
-
-stride /= sizeof(pixel);
+FUNC(transquant_bypass)(_dst, coeffs, stride, 4);
+}
 
-for (y = 0; y < 8; y++) {
-for (x = 0; x < 8; x++) {
-dst[x] = av_clip_pixel(dst[x] + *coeffs);
-coeffs++;
-}
-dst += stride;
-}
+static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs,
+   ptrdiff_t stride)
+{
+FUNC(transquant_bypass)(_dst, coeffs, stride, 8);
 }
 
 static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs,
  ptrdiff_t stride)
 {
-int x, y;
-pixel *dst = (pixel *)_dst;
-
-stride /= sizeof(pixel);
-
-for (y = 0; y < 16; y++) {
-for (x = 0; x < 16; x++) {
-dst[x] = av_clip_pixel(dst[x] + *coeffs);
-coeffs++;
-}
-dst += stride;
-}
+FUNC(transquant_bypass)(_dst, coeffs, stride, 16);
 }
 
 static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs,
  ptrdiff_t stride)
 {
-int x, y;
-pixel *dst = (pixel *)_dst;
-
-stride /= sizeof(pixel);
-
-for (y = 0; y < 32; y++) {
-for (x = 0; x < 32; x++) {
-dst[x] = av_clip_pixel(dst[x] + *coeffs);
-coeffs++;
-}
-dst += stride;
-}
+FUNC(transquant_bypass)(_dst, coeffs, stride, 32);
 }
 
 static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs,

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


[FFmpeg-cvslog] Merge commit '16c01fb4347312b6d29a6498dad627665b96a20e'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:30:41 2014 +0100| [c192be196839ae28a55b37a01209bc052b8fdbe3] | committer: 
Michael Niedermayer

Merge commit '16c01fb4347312b6d29a6498dad627665b96a20e'

* commit '16c01fb4347312b6d29a6498dad627665b96a20e':
  hevc: remove an unused function parameter

Conflicts:
libavcodec/hevc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit '84b9463984083f4e83948c73c1a5dbaf596ff3f7'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:27:12 2014 +0100| [e7fdfbdc58bd5c9c30c612ae12b4f9fd8ad13d17] | committer: 
Michael Niedermayer

Merge commit '84b9463984083f4e83948c73c1a5dbaf596ff3f7'

* commit '84b9463984083f4e83948c73c1a5dbaf596ff3f7':
  hevc: remove a redundant line

See: 83976e40e89655162e5394cf8915d9b6d89702d9
Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevc: remove a redundant line

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Nov 15 
20:40:12 2014 +0100| [84b9463984083f4e83948c73c1a5dbaf596ff3f7] | committer: 
Anton Khirnov

hevc: remove a redundant line

pred_mode is overwritten a few lines immediately below.

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

 libavcodec/hevc.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 4557bdf..f775fdf 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2078,7 +2078,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 if (s->sh.slice_type != I_SLICE) {
 uint8_t skip_flag = ff_hevc_skip_flag_decode(s, x0, y0, x_cb, y_cb);
 
-lc->cu.pred_mode = MODE_SKIP;
 x = y_cb * min_cb_width + x_cb;
 for (y = 0; y < length; y++) {
 memset(&s->skip_flag[x], skip_flag, length);

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


[FFmpeg-cvslog] hevc: remove an unused function parameter

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Nov 15 
21:18:51 2014 +0100| [16c01fb4347312b6d29a6498dad627665b96a20e] | committer: 
Anton Khirnov

hevc: remove an unused function parameter

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

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

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index f775fdf..e4e0b4b 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1233,8 +1233,7 @@ static void hls_residual_coding(HEVCContext *s, int x0, 
int y0,
 static int hls_transform_unit(HEVCContext *s, int x0, int y0,
   int xBase, int yBase, int cb_xBase, int cb_yBase,
   int log2_cb_size, int log2_trafo_size,
-  int trafo_depth, int blk_idx,
-  int cbf_luma, int cbf_cb, int cbf_cr)
+  int blk_idx, int cbf_luma, int cbf_cb, int 
cbf_cr)
 {
 HEVCLocalContext *lc = &s->HEVClc;
 
@@ -1405,7 +1404,7 @@ do {
 cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
 
 ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
- log2_cb_size, log2_trafo_size, trafo_depth,
+ log2_cb_size, log2_trafo_size,
  blk_idx, cbf_luma, cbf_cb, cbf_cr);
 if (ret < 0)
 return ret;

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


[FFmpeg-cvslog] hevc: do not store rqt_root_cbf in the context

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Nov 15 
20:00:22 2014 +0100| [2c6a7f9348378f887066fb1669c46b9485e8ef3e] | committer: 
Anton Khirnov

hevc: do not store rqt_root_cbf in the context

It does not need to be accessed outside of hls_coding_unit().

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

 libavcodec/hevc.c |7 ---
 libavcodec/hevc.h |2 --
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 5dbcc70..4557bdf 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2061,7 +2061,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 
 lc->cu.x= x0;
 lc->cu.y= y0;
-lc->cu.rqt_root_cbf = 1;
 lc->cu.pred_mode= MODE_INTRA;
 lc->cu.part_mode= PART_2Nx2N;
 lc->cu.intra_split_flag = 0;
@@ -2163,11 +2162,13 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 }
 
 if (!pcm_flag) {
+int rqt_root_cbf = 1;
+
 if (lc->cu.pred_mode != MODE_INTRA &&
 !(lc->cu.part_mode == PART_2Nx2N && lc->pu.merge_flag)) {
-lc->cu.rqt_root_cbf = 
ff_hevc_no_residual_syntax_flag_decode(s);
+rqt_root_cbf = ff_hevc_no_residual_syntax_flag_decode(s);
 }
-if (lc->cu.rqt_root_cbf) {
+if (rqt_root_cbf) {
 lc->cu.max_trafo_depth = lc->cu.pred_mode == MODE_INTRA ?
  
s->sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
  
s->sps->max_transform_hierarchy_depth_inter;
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h
index 2cc2608..37131cd 100644
--- a/libavcodec/hevc.h
+++ b/libavcodec/hevc.h
@@ -605,8 +605,6 @@ typedef struct CodingUnit {
 enum PredMode pred_mode;///< PredMode
 enum PartMode part_mode;///< PartMode
 
-uint8_t rqt_root_cbf;
-
 // Inferred parameters
 uint8_t intra_split_flag;   ///< IntraSplitFlag
 uint8_t max_trafo_depth;///< MaxTrafoDepth

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


[FFmpeg-cvslog] Merge commit '2c6a7f9348378f887066fb1669c46b9485e8ef3e'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:20:32 2014 +0100| [f1b20930f206349a666ec314d76c3fcb86c6b9a7] | committer: 
Michael Niedermayer

Merge commit '2c6a7f9348378f887066fb1669c46b9485e8ef3e'

* commit '2c6a7f9348378f887066fb1669c46b9485e8ef3e':
  hevc: do not store rqt_root_cbf in the context

Conflicts:
libavcodec/hevc.c

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] Merge commit '920bca3e2332dced9c78bd14cfc2ff138188bd57'

2014-11-17 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon Nov 17 
11:05:58 2014 +0100| [7cbe1e044701898aadda9958ddb67f6ea95fc72b] | committer: 
Michael Niedermayer

Merge commit '920bca3e2332dced9c78bd14cfc2ff138188bd57'

* commit '920bca3e2332dced9c78bd14cfc2ff138188bd57':
  hevc: do not store pcm_flag in the context

Merged-by: Michael Niedermayer 

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



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


[FFmpeg-cvslog] hevc: do not store pcm_flag in the context

2014-11-17 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Nov 15 
20:00:22 2014 +0100| [920bca3e2332dced9c78bd14cfc2ff138188bd57] | committer: 
Anton Khirnov

hevc: do not store pcm_flag in the context

It does not need to be accessed outside of hls_coding_unit().

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

 libavcodec/hevc.c |9 +
 libavcodec/hevc.h |2 --
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 9b3d339..5dbcc70 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2065,7 +2065,6 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 lc->cu.pred_mode= MODE_INTRA;
 lc->cu.part_mode= PART_2Nx2N;
 lc->cu.intra_split_flag = 0;
-lc->cu.pcm_flag = 0;
 
 SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0;
 for (x = 0; x < 4; x++)
@@ -2096,6 +2095,8 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 if (!s->sh.disable_deblocking_filter_flag)
 ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_cb_size);
 } else {
+int pcm_flag = 0;
+
 if (s->sh.slice_type != I_SLICE)
 lc->cu.pred_mode = ff_hevc_pred_mode_decode(s);
 if (lc->cu.pred_mode != MODE_INTRA ||
@@ -2109,9 +2110,9 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 if (lc->cu.part_mode == PART_2Nx2N && s->sps->pcm_enabled_flag &&
 log2_cb_size >= s->sps->pcm.log2_min_pcm_cb_size &&
 log2_cb_size <= s->sps->pcm.log2_max_pcm_cb_size) {
-lc->cu.pcm_flag = ff_hevc_pcm_flag_decode(s);
+pcm_flag = ff_hevc_pcm_flag_decode(s);
 }
-if (lc->cu.pcm_flag) {
+if (pcm_flag) {
 intra_prediction_unit_default_value(s, x0, y0, log2_cb_size);
 ret = hls_pcm_sample(s, x0, y0, log2_cb_size);
 if (s->sps->pcm.loop_filter_disable_flag)
@@ -2161,7 +2162,7 @@ static int hls_coding_unit(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 }
 }
 
-if (!lc->cu.pcm_flag) {
+if (!pcm_flag) {
 if (lc->cu.pred_mode != MODE_INTRA &&
 !(lc->cu.part_mode == PART_2Nx2N && lc->pu.merge_flag)) {
 lc->cu.rqt_root_cbf = 
ff_hevc_no_residual_syntax_flag_decode(s);
diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h
index 93c5125..2cc2608 100644
--- a/libavcodec/hevc.h
+++ b/libavcodec/hevc.h
@@ -607,8 +607,6 @@ typedef struct CodingUnit {
 
 uint8_t rqt_root_cbf;
 
-uint8_t pcm_flag;
-
 // Inferred parameters
 uint8_t intra_split_flag;   ///< IntraSplitFlag
 uint8_t max_trafo_depth;///< MaxTrafoDepth

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