[FFmpeg-cvslog] lavf/img2dec: Auto-detect Cintel scanner images.

2020-10-08 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Thu Oct  8 
09:34:55 2020 +0200| [bc43588a71181a6b2ea01119a7551f0d76a37b32] | committer: 
Carl Eugen Hoyos

lavf/img2dec: Auto-detect Cintel scanner images.

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

 libavformat/allformats.c |  1 +
 libavformat/img2dec.c| 12 
 libavformat/version.h|  2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 3912b60ec3..96b9bc2a0c 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -489,6 +489,7 @@ extern AVInputFormat  ff_yuv4mpegpipe_demuxer;
 extern AVOutputFormat ff_yuv4mpegpipe_muxer;
 /* image demuxers */
 extern AVInputFormat  ff_image_bmp_pipe_demuxer;
+extern AVInputFormat  ff_image_cri_pipe_demuxer;
 extern AVInputFormat  ff_image_dds_pipe_demuxer;
 extern AVInputFormat  ff_image_dpx_pipe_demuxer;
 extern AVInputFormat  ff_image_exr_pipe_demuxer;
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 9a3c9fad02..4f9bfc635a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -684,6 +684,17 @@ static int bmp_probe(const AVProbeData *p)
 return AVPROBE_SCORE_EXTENSION / 4;
 }
 
+static int cri_probe(const AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+
+if (   AV_RL32(b) == 1
+&& AV_RL32(b + 4) == 4
+&& AV_RN32(b + 8) == AV_RN32("DVCC"))
+return AVPROBE_SCORE_MAX - 1;
+return 0;
+}
+
 static int dds_probe(const AVProbeData *p)
 {
 const uint8_t *b = p->buf;
@@ -1101,6 +1112,7 @@ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
 };
 
 IMAGEAUTO_DEMUXER(bmp, AV_CODEC_ID_BMP)
+IMAGEAUTO_DEMUXER(cri, AV_CODEC_ID_CRI)
 IMAGEAUTO_DEMUXER(dds, AV_CODEC_ID_DDS)
 IMAGEAUTO_DEMUXER(dpx, AV_CODEC_ID_DPX)
 IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR)
diff --git a/libavformat/version.h b/libavformat/version.h
index 6a601f0c92..86e0a232ee 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  61
+#define LIBAVFORMAT_VERSION_MINOR  62
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

___
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] libavformat/dashdec: Fix issue with dash on Windows

2020-10-08 Thread Christopher Degawa
ffmpeg | branch: master | Christopher Degawa  | Thu Oct  8 
12:45:21 2020 +| [0117d5aa03aca0158ee54b806d420fb1a974b788] | committer: 
James Almer

libavformat/dashdec: Fix issue with dash on Windows

Use xmlFree instead of av_freep

snip from libxml2:

 * xmlGetProp:
...
 * Returns the attribute value or NULL if not found.
 * It's up to the caller to free the memory with xmlFree().

According to libxml2, you are supposed to use xmlFree instead of free
on the pointer returned by it, and also using av_freep on Windows will
call _aligned_free instead of normal free, causing _aligned_free to raise
SIGTRAP and crashing ffmpeg and ffplay.

Signed-off-by: Christopher Degawa 

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

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

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 99b9c45439..42ea74635b 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1145,7 +1145,7 @@ static int parse_manifest_adaptationset(AVFormatContext 
*s, const char *url,
 }
 
 err:
-av_freep(&c->adaptionset_lang);
+xmlFree(c->adaptionset_lang);
 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] configure: add missing atsc_a53 dependencies to hevcparse and h264_parser

2020-10-08 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Oct  8 10:09:39 
2020 -0300| [e9521d9298a4f88c4a14bda1938afc0967f30a47] | committer: James Almer

configure: add missing atsc_a53 dependencies to hevcparse and h264_parser

Found-by: Chris Miceli 
Signed-off-by: James Almer 

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

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1c36a8dfca..75f0a0fcaa 100755
--- a/configure
+++ b/configure
@@ -2635,7 +2635,7 @@ faandct_select="fdctdsp"
 faanidct_deps="faan"
 faanidct_select="idctdsp"
 h264dsp_select="startcode"
-hevcparse_select="golomb"
+hevcparse_select="atsc_a53 golomb"
 frame_thread_encoder_deps="encoders threads"
 intrax8_select="blockdsp idctdsp"
 mdct_select="fft"
@@ -3145,7 +3145,7 @@ av1_qsv_decoder_select="qsvdec"
 # parsers
 aac_parser_select="adts_header"
 av1_parser_select="cbs_av1"
-h264_parser_select="golomb h264dsp h264parse"
+h264_parser_select="atsc_a53 golomb h264dsp h264parse"
 hevc_parser_select="hevcparse"
 mpegaudio_parser_select="mpegaudioheader"
 mpegvideo_parser_select="mpegvideo"

___
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] avformat/dashdec: Reset pointer to NULL after freeing it

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 15:40:02 2020 +0200| [616eb93a404c088635be74498ddb04072dfe1b90] | 
committer: Andreas Rheinhardt

avformat/dashdec: Reset pointer to NULL after freeing it

This is currently safe here, because the effective lifetime of
adaptionset_lang is parse_manifest_adaptationset() (i.e. the pointer
gets overwritten each time on entry to the function and gets freed
before exiting the function), but it is nevertheless safer to reset the
pointer.

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 42ea74635b..c28bb07f44 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1146,6 +1146,7 @@ static int parse_manifest_adaptationset(AVFormatContext 
*s, const char *url,
 
 err:
 xmlFree(c->adaptionset_lang);
+c->adaptionset_lang = NULL;
 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] VP9 Profile 2 VDPAU support

2020-10-08 Thread ManojGuptaBonda
ffmpeg | branch: master | ManojGuptaBonda  | Thu Oct  8 
12:06:51 2020 +0530| [ccca62ef991f0a47dfa30c3e822d91294b8afe4c] | committer: 
Philip Langdale

VP9 Profile 2 VDPAU support

Added VDPAU to list of supported formats for VP9 420 10 and 12 bit
formats. Add VP9 10/12 Bit support for VDPAU

Signed-off-by: Philip Langdale 

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

 Changelog| 1 +
 libavcodec/version.h | 2 +-
 libavcodec/vp9.c | 6 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 0ecda9ed52..996ed2ca51 100644
--- a/Changelog
+++ b/Changelog
@@ -35,6 +35,7 @@ version :
 - AVS3 demuxer
 - AVS3 video decoder via libuavs3d
 - Cintel RAW decoder
+- VDPAU accelerated VP9 10/12bit decoding
 
 
 version 4.3:
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 935a46940d..c80fc4df86 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR 110
+#define LIBAVCODEC_VERSION_MINOR 111
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index fd0bab14a2..8b89fd68e2 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -223,6 +223,9 @@ static int update_size(AVCodecContext *avctx, int w, int h)
 #endif
 #if CONFIG_VP9_VAAPI_HWACCEL
 *fmtp++ = AV_PIX_FMT_VAAPI;
+#endif
+#if CONFIG_VP9_VDPAU_HWACCEL
+*fmtp++ = AV_PIX_FMT_VDPAU;
 #endif
 break;
 case AV_PIX_FMT_YUV420P12:
@@ -231,6 +234,9 @@ static int update_size(AVCodecContext *avctx, int w, int h)
 #endif
 #if CONFIG_VP9_VAAPI_HWACCEL
 *fmtp++ = AV_PIX_FMT_VAAPI;
+#endif
+#if CONFIG_VP9_VDPAU_HWACCEL
+*fmtp++ = AV_PIX_FMT_VDPAU;
 #endif
 break;
 }

___
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/mjpegdec: Use correct number of codes for VLC tables

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 19:22:35 2020 +0200| [a2ccfc6bb19fc42b48be86813f47d2c72db1a8ef] | 
committer: Andreas Rheinhardt

avcodec/mjpegdec: Use correct number of codes for VLC tables

Commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 made
ff_mjpeg_decode_dht() call build_vlc() with a wrong (too hight)
number of codes. The reason it worked is that the lengths of the extraneous
entries is initialized to zero and ff_init_vlc_sparse() ignores codes
with a length of zero. But using a too high number of codes was
nevertheless bad, because a) the assert in build_vlc() could have been
triggered (namely if the real amount of codes is 256) and b) the loop in
build_vlc() uses initialized data (leading to Valgrind errors [1]).
Furthermore, the old code spend CPU cycles in said loop although the
result won't be used anyway.

[1]: 
http://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-valgrind&time=20201008025137

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 44bbae010c..4128c47303 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -78,7 +78,7 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
 
 build_huffman_codes(huff_size, huff_code, bits_table);
 
-for (i = 0; i < 256; i++) {
+for (i = 0; i < nb_codes; i++) {
 huff_sym[i] = val_table[i] + 16 * is_ac;
 
 if (is_ac && !val_table[i])
@@ -295,15 +295,15 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
 /* build VLC and flush previous vlc if present */
 ff_free_vlc(&s->vlcs[class][index]);
 av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n",
-   class, index, n + 1);
+   class, index, n);
 if ((ret = build_vlc(&s->vlcs[class][index], bits_table, val_table,
- n + 1, 0, class > 0)) < 0)
+ n, 0, class > 0)) < 0)
 return ret;
 
 if (class > 0) {
 ff_free_vlc(&s->vlcs[2][index]);
 if ((ret = build_vlc(&s->vlcs[2][index], bits_table, val_table,
- n + 1, 0, 0)) < 0)
+ n, 0, 0)) < 0)
 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/mjpegdec: Use correct number of codes when init default VLCs

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 19:35:02 2020 +0200| [a21dec5d0a970a7dc710cb4d6af8f44f9be9539b] | 
committer: Andreas Rheinhardt

avcodec/mjpegdec: Use correct number of codes when init default VLCs

Commit bbc0d0c1fe2b7ecdc4367295594f084f85ad22f5 made the mjpeg decoder
use default Huffman tables when none are given, yet when initializing
the default Huffman tables, it did not use the correct number of entries
of the arrays used to initialize the tables, but instead it used the
biggest entry + 1 (as if it were a continuous array 0..biggest entry).
This worked because the ff_init_vlc_sparse() (and its predecessors)
always skipped entries with a length of zero and the length of the
corresponding elements was always initialized to zero with only the
sizes of the actually existing elements being set to a size > 0 lateron.

Yet since commit 1249698e1b424cff8e77e6a83cfdbc9d11e01aa7 this is no
longer so, as build_vlc() actually read the array containing the values
itself. This implies that the wrong length now leads to a read beyond
the end of the given array; this could lead to crashs (but usually
doesn't); it is detectable by ASAN* and this commit fixes it.

*: AddressSanitizer: global-buffer-overflow on address xy
...
xy is located 0 bytes to the right of global variable 
'avpriv_mjpeg_val_ac_luminance'

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 4128c47303..0a5ef110d1 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -96,27 +96,26 @@ static int init_default_huffman_tables(MJpegDecodeContext 
*s)
 int index;
 const uint8_t *bits;
 const uint8_t *values;
-int codes;
 int length;
 } ht[] = {
 { 0, 0, avpriv_mjpeg_bits_dc_luminance,
-avpriv_mjpeg_val_dc, 12, 12 },
+avpriv_mjpeg_val_dc, 12 },
 { 0, 1, avpriv_mjpeg_bits_dc_chrominance,
-avpriv_mjpeg_val_dc, 12, 12 },
+avpriv_mjpeg_val_dc, 12 },
 { 1, 0, avpriv_mjpeg_bits_ac_luminance,
-avpriv_mjpeg_val_ac_luminance,   251, 162 },
+avpriv_mjpeg_val_ac_luminance,   162 },
 { 1, 1, avpriv_mjpeg_bits_ac_chrominance,
-avpriv_mjpeg_val_ac_chrominance, 251, 162 },
+avpriv_mjpeg_val_ac_chrominance, 162 },
 { 2, 0, avpriv_mjpeg_bits_ac_luminance,
-avpriv_mjpeg_val_ac_luminance,   251, 162 },
+avpriv_mjpeg_val_ac_luminance,   162 },
 { 2, 1, avpriv_mjpeg_bits_ac_chrominance,
-avpriv_mjpeg_val_ac_chrominance, 251, 162 },
+avpriv_mjpeg_val_ac_chrominance, 162 },
 };
 int i, ret;
 
 for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) {
 ret = build_vlc(&s->vlcs[ht[i].class][ht[i].index],
-ht[i].bits, ht[i].values, ht[i].codes,
+ht[i].bits, ht[i].values, ht[i].length,
 0, ht[i].class == 1);
 if (ret < 0)
 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] avformat/libopenmpt: Don't discard const

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 15:46:06 2020 +0200| [39ab256125e9c44bf9f5ccfe42ee4874767f2363] | 
committer: Andreas Rheinhardt

avformat/libopenmpt: Don't discard const

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 52511aba56..b07da5f078 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -218,7 +218,7 @@ static int read_seek_openmpt(AVFormatContext *s, int 
stream_idx, int64_t ts, int
 return 0;
 }
 
-static int probe_openmpt_extension(AVProbeData *p)
+static int probe_openmpt_extension(const AVProbeData *p)
 {
 const char *ext;
 if (p->filename) {

___
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/mjpegdec: Remove use_static from build_vlc()

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 20:02:17 2020 +0200| [ea5016cd119c886c1e9caa5f9625fa7c208d6b95] | 
committer: Andreas Rheinhardt

avcodec/mjpegdec: Remove use_static from build_vlc()

It is always zero; it referred to the INIT_VLC_USE_STATIC flag which has
been removed in 595324e143b57a52e2329eb47b84395c70f93087.

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

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

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 0a5ef110d1..a56afc0fb7 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -67,7 +67,7 @@ static void build_huffman_codes(uint8_t *huff_size, uint16_t 
*huff_code,
 
 static int build_vlc(VLC *vlc, const uint8_t *bits_table,
  const uint8_t *val_table, int nb_codes,
- int use_static, int is_ac)
+ int is_ac)
 {
 uint8_t huff_size[256] = { 0 };
 uint16_t huff_code[256];
@@ -86,7 +86,7 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
 }
 
 return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1,
-  huff_code, 2, 2, huff_sym, 2, 2, use_static);
+  huff_code, 2, 2, huff_sym, 2, 2, 0);
 }
 
 static int init_default_huffman_tables(MJpegDecodeContext *s)
@@ -116,7 +116,7 @@ static int init_default_huffman_tables(MJpegDecodeContext 
*s)
 for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) {
 ret = build_vlc(&s->vlcs[ht[i].class][ht[i].index],
 ht[i].bits, ht[i].values, ht[i].length,
-0, ht[i].class == 1);
+ht[i].class == 1);
 if (ret < 0)
 return ret;
 
@@ -296,13 +296,13 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
 av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n",
class, index, n);
 if ((ret = build_vlc(&s->vlcs[class][index], bits_table, val_table,
- n, 0, class > 0)) < 0)
+ n, class > 0)) < 0)
 return ret;
 
 if (class > 0) {
 ff_free_vlc(&s->vlcs[2][index]);
 if ((ret = build_vlc(&s->vlcs[2][index], bits_table, val_table,
- n, 0, 0)) < 0)
+ n, 0)) < 0)
 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/magicyuvenc: Avoid sorting Huffman table unnecessarily

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Sep 28 15:11:52 2020 +0200| [17b003a9e29257a48b6b1bbf0e67a0416fcedbb3] | 
committer: Andreas Rheinhardt

avcodec/magicyuvenc: Avoid sorting Huffman table unnecessarily

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/magicyuvenc.c | 43 +++
 1 file changed, 15 insertions(+), 28 deletions(-)

diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 0bd6b8ef6a..9b79ac69b6 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -40,7 +40,6 @@ typedef enum Prediction {
 } Prediction;
 
 typedef struct HuffEntry {
-uint8_t  sym;
 uint8_t  len;
 uint32_t code;
 } HuffEntry;
@@ -245,32 +244,18 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static int magy_huff_cmp_len(const void *a, const void *b)
+static void calculate_codes(HuffEntry *he, uint16_t codes_count[33])
 {
-const HuffEntry *aa = a, *bb = b;
-return (aa->len - bb->len) * 256 + aa->sym - bb->sym;
-}
-
-static int huff_cmp_sym(const void *a, const void *b)
-{
-const HuffEntry *aa = a, *bb = b;
-return bb->sym - aa->sym;
-}
-
-static void calculate_codes(HuffEntry *he)
-{
-uint32_t code;
-int i;
-
-AV_QSORT(he, 256, HuffEntry, magy_huff_cmp_len);
-
-code = 1;
-for (i = 255; i >= 0; i--) {
-he[i].code  = code >> (32 - he[i].len);
-code   += 0x8000u >> (he[i].len - 1);
+for (unsigned i = 32, nb_codes = 0; i > 0; i--) {
+uint16_t curr = codes_count[i];   // # of leafs of length i
+codes_count[i] = nb_codes / 2;// # of non-leaf nodes on level i
+nb_codes = codes_count[i] + curr; // # of nodes on level i
 }
 
-AV_QSORT(he, 256, HuffEntry, huff_cmp_sym);
+for (unsigned i = 0; i < 256; i++) {
+he[i].code = codes_count[he[i].len];
+codes_count[he[i].len]++;
+}
 }
 
 static void count_usage(uint8_t *src, int width,
@@ -301,6 +286,7 @@ static int compare_by_prob(const void *a, const void *b)
 }
 
 static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts,
+  uint16_t codes_counts[33],
   int size, int max_length)
 {
 PackageMergerList list_a, list_b, *to = &list_a, *from = &list_b, *temp;
@@ -356,8 +342,8 @@ static void magy_huffman_compute_bits(PTable *prob_table, 
HuffEntry *distincts,
 }
 
 for (i = 0; i < size; i++) {
-distincts[i].sym = i;
 distincts[i].len = nbits[i];
+codes_counts[nbits[i]]++;
 }
 }
 
@@ -366,18 +352,19 @@ static int encode_table(AVCodecContext *avctx, uint8_t 
*dst,
 PutBitContext *pb, HuffEntry *he)
 {
 PTable counts[256] = { {0} };
+uint16_t codes_counts[33] = { 0 };
 int i;
 
 count_usage(dst, width, height, counts);
 
 for (i = 0; i < 256; i++) {
 counts[i].prob++;
-counts[i].value = 255 - i;
+counts[i].value = i;
 }
 
-magy_huffman_compute_bits(counts, he, 256, 12);
+magy_huffman_compute_bits(counts, he, codes_counts, 256, 12);
 
-calculate_codes(he);
+calculate_codes(he, codes_counts);
 
 for (i = 0; i < 256; i++) {
 put_bits(pb, 1, 0);

___
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/mjpegdec: Remove redundant initialization

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 20:08:12 2020 +0200| [dc3f177b8f1913ed05401b3ab0ebf6bdc7052408] | 
committer: Andreas Rheinhardt

avcodec/mjpegdec: Remove redundant initialization

Now that the correct number of codes is used, it is no longer necessary
to initialize the lengths of the codes at all any more as the length of
the actually used codes is set later anyway.

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/mjpegdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index a56afc0fb7..147dd819e5 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -69,7 +69,7 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
  const uint8_t *val_table, int nb_codes,
  int is_ac)
 {
-uint8_t huff_size[256] = { 0 };
+uint8_t huff_size[256];
 uint16_t huff_code[256];
 uint16_t huff_sym[256];
 int i;

___
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/magicyuvenc: Use more correct cast in compare function

2020-10-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Oct  8 21:14:28 2020 +0200| [32f0a000fdec70f55cdb702eface1ded8f658a00] | 
committer: Andreas Rheinhardt

avcodec/magicyuvenc: Use more correct cast in compare function

There is no need to cast const away (even if it was harmless) and to
copy the object at all.

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index 9b79ac69b6..d53fe6f328 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -280,9 +280,9 @@ typedef struct PackageMergerList {
 
 static int compare_by_prob(const void *a, const void *b)
 {
-PTable a_val = *(PTable *)a;
-PTable b_val = *(PTable *)b;
-return a_val.prob - b_val.prob;
+const PTable *a2 = a;
+const PTable *b2 = b;
+return a2->prob - b2->prob;
 }
 
 static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts,

___
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] FATE/dnn: only run unit test when CONFIG_DNN enabled

2020-10-08 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Thu Oct  8 22:00:56 
2020 +1100| [9553c0b46ad02b37c361e0ecd753cc2ce8e9f263] | committer: Guo, Yejun

FATE/dnn: only run unit test when CONFIG_DNN enabled

Signed-off-by: Peter Ross 
Reviewed-by: Guo, Yejun 

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

 tests/fate/dnn.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fate/dnn.mak b/tests/fate/dnn.mak
index 90a1bb3cac..c5e458708e 100644
--- a/tests/fate/dnn.mak
+++ b/tests/fate/dnn.mak
@@ -33,6 +33,6 @@ fate-dnn-layer-avgpool: 
$(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
 fate-dnn-layer-avgpool: CMD = run 
$(DNNTESTSDIR)/dnn-layer-avgpool-test$(EXESUF)
 fate-dnn-layer-avgpool: CMP = null
 
-FATE-yes += $(FATE_DNN)
+FATE-$(CONFIG_DNN) += $(FATE_DNN)
 
 fate-dnn: $(FATE_DNN)

___
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] avformat/rtsp: allocate correct max number of pollfds

2020-10-08 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Sat Sep 26 
18:26:30 2020 -0400| [0d156eb58a2bfb136c6481611fad7505b3a2c0c1] | committer: 
Andriy Gelman

avformat/rtsp: allocate correct max number of pollfds

There is one general rtsp connection plus two connections per stream (rtp/rtcp).

Reviewed-by: Zhao Zhili 
Signed-off-by: Andriy Gelman 

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

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

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2ce09477ed..e9fca034b4 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1990,7 +1990,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream 
**prtsp_st,
 int *fds = NULL, fdsnum, fdsidx;
 
 if (!p) {
-p = rt->p = av_malloc_array(2 * (rt->nb_rtsp_streams + 1), 
sizeof(struct pollfd));
+p = rt->p = av_malloc_array(2 * rt->nb_rtsp_streams + 1, sizeof(struct 
pollfd));
 if (!p)
 return AVERROR(ENOMEM);
 

___
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] avformat/rtspdec: add newline in log message

2020-10-08 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Sat Sep 26 
18:26:29 2020 -0400| [b4103e0eb6abd1f289042ce796f4488725fcd156] | committer: 
Andriy Gelman

avformat/rtspdec: add newline in log message

Signed-off-by: Andriy Gelman 

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

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

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index dfa29913bf..ef084a8b2b 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -291,7 +291,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, 
char *controlurl)
 AVDictionary *opts = NULL;
 av_dict_set_int(&opts, "buffer_size", rt->buffer_size, 0);
 ff_url_join(url, sizeof(url), "rtp", NULL, host, localport, NULL);
-av_log(s, AV_LOG_TRACE, "Opening: %s", url);
+av_log(s, AV_LOG_TRACE, "Opening: %s\n", url);
 ret = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, 
AVIO_FLAG_READ_WRITE,
&s->interrupt_callback, &opts,
s->protocol_whitelist, 
s->protocol_blacklist, NULL);
@@ -304,7 +304,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, 
char *controlurl)
 return ret;
 }
 
-av_log(s, AV_LOG_TRACE, "Listening on: %d",
+av_log(s, AV_LOG_TRACE, "Listening on: %d\n",
 ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle));
 if ((ret = ff_rtsp_open_transport_ctx(s, rtsp_st))) {
 rtsp_send_reply(s, RTSP_STATUS_TRANSPORT, NULL, request.seq);

___
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".