[FFmpeg-cvslog] fftools/ffmpeg_opt: Fix mixed declarations and code

2019-11-06 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Nov  6 13:18:16 2019 +0100| [fc7b6d55741a926896958939a97b2958df1c1bb4] | 
committer: Michael Niedermayer

fftools/ffmpeg_opt: Fix mixed declarations and code

Introduced in ed3c317d.

Signed-off-by: Andreas Rheinhardt 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index af9a9a6acb..71063cc443 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3007,10 +3007,11 @@ static int opt_preset(void *optctx, const char *opt, 
const char *arg)
 static int opt_old2new(void *optctx, const char *opt, const char *arg)
 {
 OptionsContext *o = optctx;
+int ret;
 char *s = av_asprintf("%s:%c", opt + 1, *opt);
 if (!s)
 return AVERROR(ENOMEM);
-int ret = parse_option(o, s, arg, options);
+ret = parse_option(o, s, arg, options);
 av_free(s);
 return ret;
 }
@@ -3087,10 +3088,11 @@ static int opt_vsync(void *optctx, const char *opt, 
const char *arg)
 static int opt_timecode(void *optctx, const char *opt, const char *arg)
 {
 OptionsContext *o = optctx;
+int ret;
 char *tcr = av_asprintf("timecode=%s", arg);
 if (!tcr)
 return AVERROR(ENOMEM);
-int ret = parse_option(o, "metadata:g", tcr, options);
+ret = parse_option(o, "metadata:g", tcr, options);
 if (ret >= 0)
 ret = av_dict_set(>g->codec_opts, "gop_timecode", arg, 0);
 av_free(tcr);

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avdevice/v4l2: Remove av_assert0 when format not supported

2019-11-06 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Mon Nov  4 
22:32:59 2019 -0500| [7b2ce27e56cfb4c55490035283a687251061bb50] | committer: 
Michael Niedermayer

avdevice/v4l2: Remove av_assert0 when format not supported

Before this commit an av_assert0 would fail if a v4l2 device did not
support a target format.
For example,
./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
would signal an abort if /dev/video0 did not support h264.

The new behaviour is to return an AVERROR(EINVAL) error code. An
av_assert0 has been added to verify this return.

Fixes #6629

Signed-off-by: Andriy Gelman 
Reviewed-by: Nicolas George 
Signed-off-by: Michael Niedermayer 

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

 libavdevice/v4l2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 446a243cf8..365bacd771 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -811,7 +811,8 @@ static int device_try_init(AVFormatContext *ctx,
 }
 
 *codec_id = ff_fmt_v4l2codec(*desired_format);
-av_assert0(*codec_id != AV_CODEC_ID_NONE);
+if (*codec_id == AV_CODEC_ID_NONE)
+av_assert0(ret == AVERROR(EINVAL));
 return ret;
 }
 

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/extract_extradata_bsf: fix typo in comments

2019-11-06 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Nov  6 15:00:59 
2019 +0800| [84c27c8c082b320ea518b48c842a6e419c5c5d89] | committer: Michael 
Niedermayer

avcodec/extract_extradata_bsf: fix typo in comments

Signed-off-by: leozhang 
Reviewed-by: Gyan 
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index 17e5deb96b..ff111de48c 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -38,10 +38,10 @@ typedef struct ExtractExtradataContext {
 int (*extract)(AVBSFContext *ctx, AVPacket *pkt,
uint8_t **data, int *size);
 
-/* AV1 specifc fields */
+/* AV1 specific fields */
 AV1Packet av1_pkt;
 
-/* H264/HEVC specifc fields */
+/* H264/HEVC specific fields */
 H2645Packet h2645_pkt;
 
 /* AVOptions */

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/Makefile: add missing vorbis_data dependency to opus encoder

2019-11-06 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Tue Nov  5 10:17:01 2019 
-0900| [9022a5e0c25a206321f5a0bbd6a078bc510795d0] | committer: Lou Logan

avcodec/Makefile: add missing vorbis_data dependency to opus encoder

Signed-off-by: Lou Logan 

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

 libavcodec/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 54862171f9..6f06e16419 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -503,7 +503,7 @@ OBJS-$(CONFIG_OPUS_DECODER)+= opusdec.o opus.o 
opus_celt.o opus_rc.o
   opus_pvq.o opus_silk.o opustab.o 
vorbis_data.o \
   opusdsp.o
 OBJS-$(CONFIG_OPUS_ENCODER)+= opusenc.o opus.o opus_rc.o opustab.o 
opus_pvq.o \
-  opusenc_psy.o
+  opusenc_psy.o vorbis_data.o
 OBJS-$(CONFIG_PAF_AUDIO_DECODER)   += pafaudio.o
 OBJS-$(CONFIG_PAF_VIDEO_DECODER)   += pafvideo.o
 OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] configure: select mdct for dca encoder

2019-11-06 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Tue Nov  5 10:01:55 2019 
-0900| [0663f0e0da7e9efcce125549b3bede71039c72aa] | committer: Lou Logan

configure: select mdct for dca encoder

Signed-off-by: Lou Logan 

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

 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index bec47d4ffe..f0be66ec8e 100755
--- a/configure
+++ b/configure
@@ -2675,6 +2675,7 @@ cook_decoder_select="audiodsp mdct sinewin"
 cscd_decoder_select="lzo"
 cscd_decoder_suggest="zlib"
 dca_decoder_select="mdct"
+dca_encoder_select="mdct"
 dds_decoder_select="texturedsp"
 dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
 dnxhd_decoder_select="blockdsp idctdsp"

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/Makefile: add missing h263data dependency to snow encoder

2019-11-06 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Tue Nov  5 10:21:10 2019 
-0900| [b973d2795224d0b66c54e67ee2d708f87cd0df59] | committer: Lou Logan

avcodec/Makefile: add missing h263data dependency to snow encoder

Signed-off-by: Lou Logan 

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

 libavcodec/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 6f06e16419..04e94f3f30 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -587,7 +587,7 @@ OBJS-$(CONFIG_SMC_DECODER) += smc.o
 OBJS-$(CONFIG_SMVJPEG_DECODER) += smvjpegdec.o
 OBJS-$(CONFIG_SNOW_DECODER)+= snowdec.o snow.o snow_dwt.o
 OBJS-$(CONFIG_SNOW_ENCODER)+= snowenc.o snow.o snow_dwt.o  
   \
-  h263.o ituh263enc.o
+  h263.o h263data.o ituh263enc.o
 OBJS-$(CONFIG_SOL_DPCM_DECODER)+= dpcm.o
 OBJS-$(CONFIG_SONIC_DECODER)   += sonic.o
 OBJS-$(CONFIG_SONIC_ENCODER)   += sonic.o

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder

2019-11-06 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Tue Nov  5 10:28:07 2019 
-0900| [a0c74060754821d2b04b84860d2d56ed15c08738] | committer: Lou Logan

avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder

Signed-off-by: Lou Logan 

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

 libavcodec/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 04e94f3f30..eee1e505f9 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -705,7 +705,7 @@ OBJS-$(CONFIG_WMAVOICE_DECODER)+= wmavoice.o \
   celp_filters.o \
   acelp_vectors.o acelp_filters.o
 OBJS-$(CONFIG_WMV1_DECODER)+= msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_WMV1_ENCODER)+= msmpeg4enc.o
+OBJS-$(CONFIG_WMV1_ENCODER)+= msmpeg4enc.o msmpeg4.o msmpeg4data.o
 OBJS-$(CONFIG_WMV2_DECODER)+= wmv2dec.o wmv2.o wmv2data.o \
   msmpeg4dec.o msmpeg4.o msmpeg4data.o
 OBJS-$(CONFIG_WMV2_ENCODER)+= wmv2enc.o wmv2.o wmv2data.o \

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/dvdec: correctly set interlaced and tff

2019-11-06 Thread Baptiste Coudurier
ffmpeg | branch: master | Baptiste Coudurier  | 
Fri Jun 28 10:33:05 2019 -0700| [33203a08e0a26598cb103508327a1dc184b27bc6] | 
committer: Baptiste Coudurier

avcodec/dvdec: correctly set interlaced and tff

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

 libavcodec/dvdec.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 89864f2edc..daa8c74328 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -542,12 +542,19 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, 
void *data,
 
 if ((ret = ff_thread_get_buffer(avctx, , 0)) < 0)
 return ret;
-frame.f->interlaced_frame = 1;
-frame.f->top_field_first  = 0;
 
 /* Determine the codec's field order from the packet */
 if ( *vsc_pack == dv_video_control ) {
-frame.f->top_field_first = !(vsc_pack[3] & 0x40);
+if (avctx->height == 720) {
+frame.f->interlaced_frame = 0;
+frame.f->top_field_first = 0;
+} else if (avctx->height == 1080) {
+frame.f->interlaced_frame = 1;
+frame.f->top_field_first = (vsc_pack[3] & 0x40) == 0x40;
+} else {
+frame.f->interlaced_frame = (vsc_pack[3] & 0x10) == 0x10;
+frame.f->top_field_first = !(vsc_pack[3] & 0x40);
+}
 }
 
 s->buf = buf;

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/dvdec: correctly decode bottom mb row in 1080i field mode

2019-11-06 Thread Baptiste Coudurier
ffmpeg | branch: master | Baptiste Coudurier  | 
Tue Jun 18 13:29:41 2019 -0700| [004ebd4b37a31adca2a9ac353985d3461806e1b0] | 
committer: Baptiste Coudurier

avcodec/dvdec: correctly decode bottom mb row in 1080i field mode

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

 libavcodec/dv.h|  2 ++
 libavcodec/dvdec.c | 90 ++
 2 files changed, 72 insertions(+), 20 deletions(-)

diff --git a/libavcodec/dv.h b/libavcodec/dv.h
index 0e97bb200e..7ef5b7c552 100644
--- a/libavcodec/dv.h
+++ b/libavcodec/dv.h
@@ -31,6 +31,7 @@
 #include "dv_profile.h"
 #include "me_cmp.h"
 #include "vlc.h"
+#include "idctdsp.h"
 
 typedef struct DVwork_chunk {
 uint16_t buf_offset;
@@ -52,6 +53,7 @@ typedef struct DVVideoContext {
 me_cmp_func ildct_cmp;
 DVwork_chunk work_chunks[4 * 12 * 27];
 uint32_t idct_factor[2 * 4 * 16 * 64];
+IDCTDSPContext idsp;
 
 int quant_deadzone;
 } DVVideoContext;
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index daa8c74328..cfa0fb9905 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -45,7 +45,6 @@
 #include "dv_profile_internal.h"
 #include "dvdata.h"
 #include "get_bits.h"
-#include "idctdsp.h"
 #include "internal.h"
 #include "put_bits.h"
 #include "simple_idct.h"
@@ -177,24 +176,22 @@ static void dv_init_weight_tables(DVVideoContext *ctx, 
const AVDVProfile *d)
 static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
 {
 DVVideoContext *s = avctx->priv_data;
-IDCTDSPContext idsp;
 int i;
 
-memset(,0, sizeof(idsp));
-ff_idctdsp_init(, avctx);
+ff_idctdsp_init(>idsp, avctx);
 
 for (i = 0; i < 64; i++)
-s->dv_zigzag[0][i] = idsp.idct_permutation[ff_zigzag_direct[i]];
+s->dv_zigzag[0][i] = s->idsp.idct_permutation[ff_zigzag_direct[i]];
 
 if (avctx->lowres){
 for (i = 0; i < 64; i++){
 int j = ff_dv_zigzag248_direct[i];
-s->dv_zigzag[1][i] = idsp.idct_permutation[(j & 7) + (j & 8) * 4 + 
(j & 48) / 2];
+s->dv_zigzag[1][i] = s->idsp.idct_permutation[(j & 7) + (j & 8) * 
4 + (j & 48) / 2];
 }
 }else
 memcpy(s->dv_zigzag[1], ff_dv_zigzag248_direct, 
sizeof(s->dv_zigzag[1]));
 
-s->idct_put[0] = idsp.idct_put;
+s->idct_put[0] = s->idsp.idct_put;
 s->idct_put[1] = ff_simple_idct248_put;
 
 return ff_dvvideo_init(avctx);
@@ -272,6 +269,49 @@ static inline void bit_copy(PutBitContext *pb, 
GetBitContext *gb)
 put_bits(pb, bits_left, get_bits(gb, bits_left));
 }
 
+static av_always_inline void put_block_8x4(int16_t *block, uint8_t *restrict 
p, int stride)
+{
+int i, j;
+const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
+
+for (i = 0; i < 4; i++) {
+for (j = 0; j < 8; j++)
+p[j] = cm[block[j]];
+block += 8;
+p += stride;
+}
+}
+
+static void dv100_idct_put_last_row_field_chroma(DVVideoContext *s, uint8_t 
*data,
+ int stride, int16_t *blocks)
+{
+s->idsp.idct(blocks + 0*64);
+s->idsp.idct(blocks + 1*64);
+
+put_block_8x4(blocks+0*64,   data,  stride<<1);
+put_block_8x4(blocks+0*64 + 4*8, data + 8,  stride<<1);
+put_block_8x4(blocks+1*64,   data + stride, stride<<1);
+put_block_8x4(blocks+1*64 + 4*8, data + 8 + stride, stride<<1);
+}
+
+static void dv100_idct_put_last_row_field_luma(DVVideoContext *s, uint8_t 
*data,
+   int stride, int16_t *blocks)
+{
+s->idsp.idct(blocks + 0*64);
+s->idsp.idct(blocks + 1*64);
+s->idsp.idct(blocks + 2*64);
+s->idsp.idct(blocks + 3*64);
+
+put_block_8x4(blocks+0*64,   data,   stride<<1);
+put_block_8x4(blocks+0*64 + 4*8, data + 16,  stride<<1);
+put_block_8x4(blocks+1*64,   data + 8,   stride<<1);
+put_block_8x4(blocks+1*64 + 4*8, data + 24,  stride<<1);
+put_block_8x4(blocks+2*64,   data + stride,  stride<<1);
+put_block_8x4(blocks+2*64 + 4*8, data + 16 + stride, stride<<1);
+put_block_8x4(blocks+3*64,   data + 8  + stride, stride<<1);
+put_block_8x4(blocks+3*64 + 4*8, data + 24 + stride, stride<<1);
+}
+
 /* mb_x and mb_y are in units of 8 pixels */
 static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
 {
@@ -443,14 +483,18 @@ retry:
 }
 y_ptr= s->frame->data[0] +
((mb_y * s->frame->linesize[0] + mb_x) << log2_blocksize);
-linesize = s->frame->linesize[0] << is_field_mode[mb_index];
-mb[0].idct_put(y_ptr, linesize, block + 0 * 64);
-if (s->sys->video_stype == 4) { /* SD 422 */
-mb[2].idct_put(y_ptr + (1 << log2_blocksize),linesize, 
block + 2 * 64);
+if (mb_y == 134 && is_field_mode[mb_index]) {
+dv100_idct_put_last_row_field_luma(s, y_ptr,