[FFmpeg-cvslog] avcodec: add CRI HCA decoder

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 15 13:28:13 
2020 +0100| [fed0de3728c201ac15d8cf9bb1acc046a1b5230e] | committer: Paul B Mahol

avcodec: add CRI HCA decoder

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

 Changelog   |   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/hca_data.h   | 174 +++
 libavcodec/hcadec.c | 453 
 libavcodec/version.h|   2 +-
 8 files changed, 639 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index a3b12f1c55..8c5b6a89a1 100644
--- a/Changelog
+++ b/Changelog
@@ -52,6 +52,7 @@ version :
 - FWSE demuxer
 - DERF DPCM decoder
 - DERF demuxer
+- CRI HCA decoder
 
 
 version 4.2:
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a88643b7d2..c1c9a44f2b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -367,6 +367,7 @@ OBJS-$(CONFIG_H264_V4L2M2M_DECODER)+= v4l2_m2m_dec.o
 OBJS-$(CONFIG_H264_V4L2M2M_ENCODER)+= v4l2_m2m_enc.o
 OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
 OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o
+OBJS-$(CONFIG_HCA_DECODER) += hcadec.o
 OBJS-$(CONFIG_HCOM_DECODER)+= hcom.o
 OBJS-$(CONFIG_HEVC_DECODER)+= hevcdec.o hevc_mvs.o \
   hevc_cabac.o hevc_refs.o hevcpred.o  
  \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 71e14c73e3..b3184af954 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -432,6 +432,7 @@ extern AVCodec ff_g723_1_decoder;
 extern AVCodec ff_g729_decoder;
 extern AVCodec ff_gsm_decoder;
 extern AVCodec ff_gsm_ms_decoder;
+extern AVCodec ff_hca_decoder;
 extern AVCodec ff_hcom_decoder;
 extern AVCodec ff_iac_decoder;
 extern AVCodec ff_ilbc_decoder;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e9c658fddc..6e03cb5902 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -668,6 +668,7 @@ enum AVCodecID {
 AV_CODEC_ID_ACELP_KELVIN,
 AV_CODEC_ID_MPEGH_3D_AUDIO,
 AV_CODEC_ID_SIREN,
+AV_CODEC_ID_HCA,
 
 /* subtitle codecs */
 AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,  ///< A dummy ID pointing at 
the start of subtitle codecs.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 130e08c1f2..ece6eadae4 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3079,6 +3079,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Siren"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_HCA,
+.type  = AVMEDIA_TYPE_AUDIO,
+.name  = "hca",
+.long_name = NULL_IF_CONFIG_SMALL("CRI HCA"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+},
 
 /* subtitle codecs */
 {
diff --git a/libavcodec/hca_data.h b/libavcodec/hca_data.h
new file mode 100644
index 00..80b4a794dc
--- /dev/null
+++ b/libavcodec/hca_data.h
@@ -0,0 +1,174 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#ifndef AVCODEC_HCA_DATA_H
+#define AVCODEC_HCA_DATA_H
+
+#include 
+
+static const uint8_t max_bits_table[] = {
+0, 2, 3, 3, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+};
+
+static const uint8_t quant_spectrum_bits[] =
+{
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,
+2,2,2,2,2,2,3,3,0,0,0,0,0,0,0,0,
+2,2,3,3,3,3,3,3,0,0,0,0,0,0,0,0,
+3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,
+3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,
+3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,
+3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+};
+
+static const int8_t quant_spectrum_value[] =
+{
++0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,
++0,+0,+1,-1,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,
++0,+0,+1,+1,-1,-1,+2,-2,+0,+0,+0,+0,+0,+0,+0,+0,
++0,+0,+1,-1,+2,-2,+3,-3,+0,+0,+0,+0,+0,+0,+0,+0,
++0,+0,+1,+1,-1,-1,+2,+2,-2,-2,+3,+3,-3,-3,+4,-4,
++0,+0,+1,+1,-1,-1,+2,+2,-2,-2,+3,-3,+4,-4,+5,-5,
++0,+0,+1,+1,-1,-1,+2,-2,+3,-3,+4,-4,+5,-5,+6,-6,
++0,+0,+1,-1,+2,-2,+3,

[FFmpeg-cvslog] avcodec: add derf dpcm decoder

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 15 11:03:27 
2020 +0100| [c6bbdba9cd8f022e1f697f624818431499d30fe1] | committer: Paul B Mahol

avcodec: add derf dpcm decoder

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

 Changelog   |  1 +
 libavcodec/Makefile |  1 +
 libavcodec/allcodecs.c  |  1 +
 libavcodec/avcodec.h|  1 +
 libavcodec/codec_desc.c |  7 +++
 libavcodec/dpcm.c   | 32 
 libavcodec/utils.c  |  1 +
 7 files changed, 44 insertions(+)

diff --git a/Changelog b/Changelog
index 219afbd08a..2bd1181df9 100644
--- a/Changelog
+++ b/Changelog
@@ -50,6 +50,7 @@ version :
 - avgblur_vulkan, overlay_vulkan, scale_vulkan and chromaber_vulkan filters
 - ADPCM IMA MTF decoder
 - FWSE demuxer
+- DERF DPCM decoder
 
 
 version 4.2:
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b50a26907f..a88643b7d2 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -265,6 +265,7 @@ OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o 
dcadata.o dcahuff.o \
 OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o dcadata.o dcahuff.o \
   dcaadpcm.o
 OBJS-$(CONFIG_DDS_DECODER) += dds.o
+OBJS-$(CONFIG_DERF_DPCM_DECODER)   += dpcm.o
 OBJS-$(CONFIG_DIRAC_DECODER)   += diracdec.o dirac.o diracdsp.o 
diractab.o \
   dirac_arith.o dirac_dwt.o dirac_vlc.o
 OBJS-$(CONFIG_DFA_DECODER) += dfa.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 379c5f7b81..6046b15164 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -569,6 +569,7 @@ extern AVCodec ff_pcm_vidc_encoder;
 extern AVCodec ff_pcm_vidc_decoder;
 
 /* DPCM codecs */
+extern AVCodec ff_derf_dpcm_decoder;
 extern AVCodec ff_gremlin_dpcm_decoder;
 extern AVCodec ff_interplay_dpcm_decoder;
 extern AVCodec ff_roq_dpcm_encoder;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 9ac97a122b..e9c658fddc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -571,6 +571,7 @@ enum AVCodecID {
 
 AV_CODEC_ID_SDX2_DPCM = 0x14800,
 AV_CODEC_ID_GREMLIN_DPCM,
+AV_CODEC_ID_DERF_DPCM,
 
 /* audio codecs */
 AV_CODEC_ID_MP2 = 0x15000,
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index df3671765a..130e08c1f2 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2415,6 +2415,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("DPCM Gremlin"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_DERF_DPCM,
+.type  = AVMEDIA_TYPE_AUDIO,
+.name  = "derf_dpcm",
+.long_name = NULL_IF_CONFIG_SMALL("DPCM Xilam DERF"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+},
 
 /* audio codecs */
 {
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 5958081b66..069bf1dcd8 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -49,6 +49,21 @@ typedef struct DPCMContext {
 const int8_t *sol_table;///< delta table for SOL_DPCM
 } DPCMContext;
 
+static const int32_t derf_steps[96] = {
+0, 1, 2, 3, 4, 5, 6, 7,
+8, 9, 10, 11, 12, 13, 14, 16,
+17, 19, 21, 23, 25, 28, 31, 34,
+37, 41, 45, 50, 55, 60, 66, 73,
+80, 88, 97, 107, 118, 130, 143, 157,
+173, 190, 209, 230, 253, 279, 307, 337,
+371, 408, 449, 494, 544, 598, 658, 724,
+796, 876, 963, 1060, 1166, 1282, 1411, 1552,
+1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
+3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132,
+7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289,
+16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767,
+};
+
 static const int16_t interplay_delta_table[] = {
  0,  1,  2,  3,  4,  5,  6,  7,
  8,  9, 10, 11, 12, 13, 14, 15,
@@ -225,6 +240,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void 
*data,
 else
 out = buf_size;
 break;
+case AV_CODEC_ID_DERF_DPCM:
 case AV_CODEC_ID_GREMLIN_DPCM:
 case AV_CODEC_ID_SDX2_DPCM:
 out = buf_size;
@@ -372,6 +388,21 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void 
*data,
 }
 }
 break;
+
+case AV_CODEC_ID_DERF_DPCM: {
+int idx = 0;
+
+while (output_samples < samples_end) {
+uint8_t n = bytestream2_get_byteu(&gb);
+int index = FFMIN(n & 0x7f, 95);
+
+s->sample[idx] += (n & 0x80 ? -1: 1) * derf_steps[index];
+s->sample[idx]  = av_clip_int16(s->sample[idx]);
+*output_samples++ = s->sample[idx];
+idx ^= stereo;
+}
+}
+break;
 }
 
 *got_frame_ptr = 1;
@@ -391,6 +422,7 @@ AVCodec ff_ ## name_ ## _decoder = {

[FFmpeg-cvslog] avformat: add derf demuxer

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 15 10:47:29 
2020 +0100| [4f248a34c5736c47337195b232c9d4989a91ef08] | committer: Paul B Mahol

avformat: add derf demuxer

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

 Changelog|  1 +
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/derf.c   | 79 
 4 files changed, 82 insertions(+)

diff --git a/Changelog b/Changelog
index 2bd1181df9..a3b12f1c55 100644
--- a/Changelog
+++ b/Changelog
@@ -51,6 +51,7 @@ version :
 - ADPCM IMA MTF decoder
 - FWSE demuxer
 - DERF DPCM decoder
+- DERF demuxer
 
 
 version 4.2:
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 71eeb45175..9b1f74a5c7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -151,6 +151,7 @@ OBJS-$(CONFIG_DASH_DEMUXER)  += dash.o dashdec.o
 OBJS-$(CONFIG_DAUD_DEMUXER)  += dauddec.o
 OBJS-$(CONFIG_DAUD_MUXER)+= daudenc.o
 OBJS-$(CONFIG_DCSTR_DEMUXER) += dcstr.o
+OBJS-$(CONFIG_DERF_DEMUXER)  += derf.o pcm.o
 OBJS-$(CONFIG_DFA_DEMUXER)   += dfa.o
 OBJS-$(CONFIG_DHAV_DEMUXER)  += dhav.o
 OBJS-$(CONFIG_DIRAC_DEMUXER) += diracdec.o rawdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index d275c1017b..af10def88b 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -113,6 +113,7 @@ extern AVOutputFormat ff_data_muxer;
 extern AVInputFormat  ff_daud_demuxer;
 extern AVOutputFormat ff_daud_muxer;
 extern AVInputFormat  ff_dcstr_demuxer;
+extern AVInputFormat  ff_derf_demuxer;
 extern AVInputFormat  ff_dfa_demuxer;
 extern AVInputFormat  ff_dhav_demuxer;
 extern AVInputFormat  ff_dirac_demuxer;
diff --git a/libavformat/derf.c b/libavformat/derf.c
new file mode 100644
index 00..58bbf5b791
--- /dev/null
+++ b/libavformat/derf.c
@@ -0,0 +1,79 @@
+/*
+ * DERF demuxer
+ * Copyright (c) 2020 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "internal.h"
+#include "pcm.h"
+
+static int derf_probe(const AVProbeData *p)
+{
+if (AV_RL32(p->buf) != MKTAG('D','E','R','F'))
+return 0;
+if (AV_RL32(p->buf+4) != 1 && AV_RL32(p->buf+4) != 2)
+return 0;
+
+return AVPROBE_SCORE_MAX / 3 * 2;
+}
+
+static int derf_read_header(AVFormatContext *s)
+{
+unsigned data_size;
+AVIOContext *pb = s->pb;
+AVCodecParameters *par;
+AVStream *st;
+
+avio_skip(pb, 4);
+
+st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+par  = st->codecpar;
+par->codec_type  = AVMEDIA_TYPE_AUDIO;
+par->codec_id= AV_CODEC_ID_DERF_DPCM;
+par->format  = AV_SAMPLE_FMT_S16;
+par->channels= avio_rl32(pb);
+if (par->channels != 1 && par->channels != 2)
+return AVERROR_INVALIDDATA;
+if (par->channels == 1)
+par->channel_layout = AV_CH_LAYOUT_MONO;
+else if (par->channels == 2)
+par->channel_layout = AV_CH_LAYOUT_STEREO;
+data_size = avio_rl32(pb);
+st->duration = data_size / par->channels;
+par->sample_rate = 22050;
+par->block_align = 1;
+
+avpriv_set_pts_info(st, 64, 1, par->sample_rate);
+
+return 0;
+}
+
+AVInputFormat ff_derf_demuxer = {
+.name   = "derf",
+.long_name  = NULL_IF_CONFIG_SMALL("Xilam DERF"),
+.read_probe = derf_probe,
+.read_header= derf_read_header,
+.read_packet= ff_pcm_read_packet,
+.read_seek  = ff_pcm_read_seek,
+.extensions = "adp",
+};

___
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: add hca demuxer

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 15 13:55:15 
2020 +0100| [7322eab453f7d60c66846d22a14b77d3c9ae5cc3] | committer: Paul B Mahol

avformat: add hca demuxer

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

 Changelog|   1 +
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/hca.c| 124 +++
 libavformat/version.h|   2 +-
 5 files changed, 128 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 8c5b6a89a1..711861bda9 100644
--- a/Changelog
+++ b/Changelog
@@ -53,6 +53,7 @@ version :
 - DERF DPCM decoder
 - DERF demuxer
 - CRI HCA decoder
+- CRI HCA demuxer
 
 
 version 4.2:
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 9b1f74a5c7..8fd0d43721 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -224,6 +224,7 @@ OBJS-$(CONFIG_H263_MUXER)+= rawenc.o
 OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
+OBJS-$(CONFIG_HCA_DEMUXER)   += hca.o
 OBJS-$(CONFIG_HCOM_DEMUXER)  += hcom.o pcm.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index af10def88b..39d2c352f5 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -182,6 +182,7 @@ extern AVOutputFormat ff_h263_muxer;
 extern AVInputFormat  ff_h264_demuxer;
 extern AVOutputFormat ff_h264_muxer;
 extern AVOutputFormat ff_hash_muxer;
+extern AVInputFormat  ff_hca_demuxer;
 extern AVInputFormat  ff_hcom_demuxer;
 extern AVOutputFormat ff_hds_muxer;
 extern AVInputFormat  ff_hevc_demuxer;
diff --git a/libavformat/hca.c b/libavformat/hca.c
new file mode 100644
index 00..8f55e07204
--- /dev/null
+++ b/libavformat/hca.c
@@ -0,0 +1,124 @@
+/*
+ * HCA demuxer
+ * Copyright (c) 2020 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "libavcodec/bytestream.h"
+
+#include "avformat.h"
+#include "internal.h"
+
+static int hca_probe(const AVProbeData *p)
+{
+if (AV_RL32(p->buf) != MKTAG('H', 'C', 'A', 0))
+return 0;
+
+if (AV_RL32(p->buf + 8) != MKTAG('f', 'm', 't', 0))
+return 0;
+
+return AVPROBE_SCORE_MAX / 3;
+}
+
+static int hca_read_header(AVFormatContext *s)
+{
+AVCodecParameters *par;
+GetByteContext gb;
+AVIOContext *pb = s->pb;
+AVStream *st;
+uint32_t chunk;
+uint16_t version;
+uint32_t block_count;
+uint16_t block_size;
+int ret;
+
+avio_skip(pb, 4);
+version = avio_rb16(pb);
+
+s->internal->data_offset = avio_rb16(pb);
+if (s->internal->data_offset <= 8)
+return AVERROR_INVALIDDATA;
+
+st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+par = st->codecpar;
+ret = ff_alloc_extradata(par, s->internal->data_offset);
+if (ret < 0)
+return ret;
+
+ret = avio_read(pb, par->extradata + 8, par->extradata_size - 8);
+if (ret < par->extradata_size - 8)
+return AVERROR(EIO);
+AV_WL32(par->extradata, MKTAG('H', 'C', 'A', 0));
+AV_WB16(par->extradata + 4, version);
+AV_WB16(par->extradata + 6, s->internal->data_offset);
+
+bytestream2_init(&gb, par->extradata + 8, par->extradata_size - 8);
+
+if (bytestream2_get_le32(&gb) != MKTAG('f', 'm', 't', 0))
+return AVERROR_INVALIDDATA;
+
+par->codec_type  = AVMEDIA_TYPE_AUDIO;
+par->codec_id= AV_CODEC_ID_HCA;
+par->codec_tag   = 0;
+par->channels= bytestream2_get_byte(&gb);
+par->sample_rate = bytestream2_get_be24(&gb);
+block_count  = bytestream2_get_be32(&gb);
+bytestream2_skip(&gb, 4);
+chunk = bytestream2_get_le32(&gb);
+if (chunk == MKTAG('c', 'o', 'm', 'p')) {
+block_size = bytestream2_get_be16(&gb);
+} else if (chunk == MKTAG('d', 'e', 'c', 0)) {
+block_size = bytestream2_get_be16(&gb);
+} else {
+return AVERROR_INVALIDDATA;
+}
+
+if (block_size < 8)

[FFmpeg-cvslog] avformat: add fwse demuxer

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Mar 14 11:37:40 
2020 +0100| [30a73361fa7ca18d9617ef5dbfaf8755da6c2dd9] | committer: Paul B Mahol

avformat: add fwse demuxer

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

 Changelog|  1 +
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/fwse.c   | 88 
 4 files changed, 91 insertions(+)

diff --git a/Changelog b/Changelog
index 93d20eef7d..219afbd08a 100644
--- a/Changelog
+++ b/Changelog
@@ -49,6 +49,7 @@ version :
 - Vulkan support
 - avgblur_vulkan, overlay_vulkan, scale_vulkan and chromaber_vulkan filters
 - ADPCM IMA MTF decoder
+- FWSE demuxer
 
 
 version 4.2:
diff --git a/libavformat/Makefile b/libavformat/Makefile
index f84becd30a..71eeb45175 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -198,6 +198,7 @@ OBJS-$(CONFIG_FRAMEHASH_MUXER)   += hashenc.o 
framehash.o
 OBJS-$(CONFIG_FRAMEMD5_MUXER)+= hashenc.o framehash.o
 OBJS-$(CONFIG_FRM_DEMUXER)   += frmdec.o
 OBJS-$(CONFIG_FSB_DEMUXER)   += fsb.o
+OBJS-$(CONFIG_FWSE_DEMUXER)  += fwse.o pcm.o
 OBJS-$(CONFIG_GIF_MUXER) += gif.o
 OBJS-$(CONFIG_GIF_DEMUXER)   += gifdec.o
 OBJS-$(CONFIG_GSM_DEMUXER)   += gsmdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 08012ea208..d275c1017b 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -156,6 +156,7 @@ extern AVOutputFormat ff_framehash_muxer;
 extern AVOutputFormat ff_framemd5_muxer;
 extern AVInputFormat  ff_frm_demuxer;
 extern AVInputFormat  ff_fsb_demuxer;
+extern AVInputFormat  ff_fwse_demuxer;
 extern AVInputFormat  ff_g722_demuxer;
 extern AVOutputFormat ff_g722_muxer;
 extern AVInputFormat  ff_g723_1_demuxer;
diff --git a/libavformat/fwse.c b/libavformat/fwse.c
new file mode 100644
index 00..00e2e13b11
--- /dev/null
+++ b/libavformat/fwse.c
@@ -0,0 +1,88 @@
+/*
+ * FWSE demuxer
+ * Copyright (c) 2020 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg 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.
+ *
+ * FFmpeg 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 FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "avformat.h"
+#include "internal.h"
+#include "pcm.h"
+
+static int fwse_probe(const AVProbeData *p)
+{
+if (AV_RL32(p->buf) != MKTAG('F','W','S','E'))
+return 0;
+if (AV_RL32(p->buf+4) != 2 && AV_RL32(p->buf+4) != 3)
+return 0;
+if (AV_RL32(p->buf+16) != 1 && AV_RL32(p->buf+16) != 2)
+return 0;
+
+return AVPROBE_SCORE_MAX / 4 * 3;
+}
+
+static int fwse_read_header(AVFormatContext *s)
+{
+unsigned start_offset, version;
+AVIOContext *pb = s->pb;
+AVCodecParameters *par;
+AVStream *st;
+
+avio_skip(pb, 4);
+version = avio_rl32(pb);
+if (version != 2 && version != 3)
+return AVERROR_INVALIDDATA;
+avio_skip(pb, 4);
+start_offset = avio_rl32(pb);
+
+st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+par  = st->codecpar;
+par->codec_type  = AVMEDIA_TYPE_AUDIO;
+par->codec_id= AV_CODEC_ID_ADPCM_IMA_MTF;
+par->format  = AV_SAMPLE_FMT_S16;
+par->channels= avio_rl32(pb);
+if (par->channels != 1 && par->channels != 2)
+return AVERROR_INVALIDDATA;
+if (par->channels == 1)
+par->channel_layout = AV_CH_LAYOUT_MONO;
+else if (par->channels == 2)
+par->channel_layout = AV_CH_LAYOUT_STEREO;
+st->duration = avio_rl32(pb);
+par->sample_rate = avio_rl32(pb);
+if (par->sample_rate <= 0 || par->sample_rate > INT_MAX)
+return AVERROR_INVALIDDATA;
+
+par->block_align = 1;
+avio_skip(pb, start_offset - avio_tell(pb));
+
+avpriv_set_pts_info(st, 64, 1, par->sample_rate);
+
+return 0;
+}
+
+AVInputFormat ff_fwse_demuxer = {
+.name   = "fwse",
+.long_name  = NULL_IF_CONFIG_SMALL("Capcom's MT Framework sound"),
+.read_probe = fwse_probe,
+.read_header= fwse_read_header,
+.read_packet= ff_pcm_read_packet,
+.extensions = "fwse",
+};

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

[FFmpeg-cvslog] avcodec/allcodecs: move sdx2 to correct place

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Mar 15 11:37:02 
2020 +0100| [0bbc4914da07bfe3351354e0f2fa85e5cb437e98] | committer: Paul B Mahol

avcodec/allcodecs: move sdx2 to correct place

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

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

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 6046b15164..71e14c73e3 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -275,7 +275,6 @@ extern AVCodec ff_s302m_decoder;
 extern AVCodec ff_sanm_decoder;
 extern AVCodec ff_scpr_decoder;
 extern AVCodec ff_screenpresso_decoder;
-extern AVCodec ff_sdx2_dpcm_decoder;
 extern AVCodec ff_sgi_encoder;
 extern AVCodec ff_sgi_decoder;
 extern AVCodec ff_sgirle_decoder;
@@ -574,6 +573,7 @@ extern AVCodec ff_gremlin_dpcm_decoder;
 extern AVCodec ff_interplay_dpcm_decoder;
 extern AVCodec ff_roq_dpcm_encoder;
 extern AVCodec ff_roq_dpcm_decoder;
+extern AVCodec ff_sdx2_dpcm_decoder;
 extern AVCodec ff_sol_dpcm_decoder;
 extern AVCodec ff_xan_dpcm_decoder;
 

___
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: add ADPCM IMA MTF decoder

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Mar 14 11:55:58 
2020 +0100| [230703a9fa48a93b7ec54903584e9ec9c947eefc] | committer: Paul B Mahol

avcodec: add ADPCM IMA MTF decoder

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

 Changelog   |  1 +
 libavcodec/Makefile |  1 +
 libavcodec/adpcm.c  | 33 +
 libavcodec/allcodecs.c  |  1 +
 libavcodec/avcodec.h|  1 +
 libavcodec/codec_desc.c |  7 +++
 6 files changed, 44 insertions(+)

diff --git a/Changelog b/Changelog
index d1572553a5..93d20eef7d 100644
--- a/Changelog
+++ b/Changelog
@@ -48,6 +48,7 @@ version :
 - AMQP 0-9-1 protocol (RabbitMQ)
 - Vulkan support
 - avgblur_vulkan, overlay_vulkan, scale_vulkan and chromaber_vulkan filters
+- ADPCM IMA MTF decoder
 
 
 version 4.2:
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a3326a45e7..b50a26907f 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -843,6 +843,7 @@ OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER)  += adpcm.o 
adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER)  += adpcm.o adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER)  += adpcm.o adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_ISS_DECODER)  += adpcm.o adpcm_data.o
+OBJS-$(CONFIG_ADPCM_IMA_MTF_DECODER)  += adpcm.o adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_OKI_DECODER)  += adpcm.o adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER)   += adpcm.o adpcm_data.o
 OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER)   += adpcmenc.o adpcm_data.o
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 4f5980f7d5..e9abddc43c 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -89,6 +89,11 @@ static const int8_t zork_index_table[8] = {
 -1, -1, -1, 1, 4, 7, 10, 12,
 };
 
+static const int8_t mtf_index_table[16] = {
+ 8,  6,  4,  2, -1, -1, -1, -1,
+-1, -1, -1, -1,  2,  4,  6,  8,
+};
+
 /* end of tables */
 
 typedef struct ADPCMDecodeContext {
@@ -304,6 +309,22 @@ static inline int16_t 
adpcm_ima_alp_expand_nibble(ADPCMChannelStatus *c, int8_t
 return (int16_t)c->predictor;
 }
 
+static inline int16_t adpcm_ima_mtf_expand_nibble(ADPCMChannelStatus *c, int 
nibble)
+{
+int step_index, step, delta, predictor;
+
+step = ff_adpcm_step_table[c->step_index];
+
+delta = step * (2 * nibble - 15);
+predictor = c->predictor + delta;
+
+step_index = c->step_index + mtf_index_table[(unsigned)nibble];
+c->predictor = av_clip_int16(predictor >> 4);
+c->step_index = av_clip(step_index, 0, 88);
+
+return (int16_t)c->predictor;
+}
+
 static inline int16_t adpcm_ima_wav_expand_nibble(ADPCMChannelStatus *c, 
GetBitContext *gb, int bps)
 {
 int nibble, step_index, predictor, sign, delta, diff, step, shift;
@@ -700,6 +721,7 @@ static int get_nb_samples(AVCodecContext *avctx, 
GetByteContext *gb,
 case AV_CODEC_ID_ADPCM_IMA_SSI:
 case AV_CODEC_ID_ADPCM_IMA_APM:
 case AV_CODEC_ID_ADPCM_IMA_ALP:
+case AV_CODEC_ID_ADPCM_IMA_MTF:
 nb_samples = buf_size * 2 / ch;
 break;
 }
@@ -1956,6 +1978,16 @@ static int adpcm_decode_frame(AVCodecContext *avctx, 
void *data,
 *samples++ = adpcm_zork_expand_nibble(&c->status[n % 
avctx->channels], v);
 }
 break;
+case AV_CODEC_ID_ADPCM_IMA_MTF:
+for (n = nb_samples / 2; n > 0; n--) {
+for (channel = 0; channel < avctx->channels; channel++) {
+int v = bytestream2_get_byteu(&gb);
+*samples++  = adpcm_ima_mtf_expand_nibble(&c->status[channel], 
v >> 4);
+samples[st] = adpcm_ima_mtf_expand_nibble(&c->status[channel], 
v & 0x0F);
+}
+samples += avctx->channels;
+}
+break;
 default:
 av_assert0(0); // unsupported codec_id should not happen
 }
@@ -2027,6 +2059,7 @@ ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_DK4, 
sample_fmts_s16,  adpcm_ima_dk4,
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_EA_EACS, sample_fmts_s16,  
adpcm_ima_ea_eacs, "ADPCM IMA Electronic Arts EACS");
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_EA_SEAD, sample_fmts_s16,  
adpcm_ima_ea_sead, "ADPCM IMA Electronic Arts SEAD");
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_ISS, sample_fmts_s16,  adpcm_ima_iss,  
   "ADPCM IMA Funcom ISS");
+ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_MTF, sample_fmts_s16,  adpcm_ima_mtf,  
   "ADPCM IMA Capcom's MT Framework");
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_OKI, sample_fmts_s16,  adpcm_ima_oki,  
   "ADPCM IMA Dialogic OKI");
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_QT,  sample_fmts_s16p, adpcm_ima_qt,   
   "ADPCM IMA QuickTime");
 ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_RAD, sample_fmts_s16,  adpcm_ima_rad,  
   "ADPCM IMA Radical");
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index f4cf180716..379c5f7b81 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -608,6 +608,7 @@ extern AVCodec ff_adpcm_ima_dk4_decoder;
 extern AVCodec ff_adpcm_ima_ea_eacs_de

[FFmpeg-cvslog] doc/general: move apdcm zork to right place

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 17 16:36:54 
2020 +0100| [a6fd2863ce8eb8c421df1d68586418796169c316] | committer: Paul B Mahol

doc/general: move apdcm zork to right place

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

 doc/general.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/general.texi b/doc/general.texi
index f4c7fc5a9f..0beab3e0d1 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -1137,6 +1137,7 @@ following image formats are supported:
 @item ADPCM Westwood Studios IMA @tab @tab  X
 @tab Used in Westwood Studios games like Command and Conquer.
 @item ADPCM Yamaha   @tab  X  @tab  X
+@item ADPCM Zork @tab @tab  X
 @item AMR-NB @tab  E  @tab  X
 @tab encoding supported through external library libopencore-amrnb
 @item AMR-WB @tab  E  @tab  X
@@ -1244,7 +1245,6 @@ following image formats are supported:
 @item PCM unsigned 24-bit little-endian  @tab  X  @tab  X
 @item PCM unsigned 32-bit big-endian  @tab  X  @tab  X
 @item PCM unsigned 32-bit little-endian  @tab  X  @tab  X
-@item PCM Zork   @tab @tab  X
 @item QCELP / PureVoice  @tab @tab  X
 @item QDesign Music Codec 1  @tab @tab  X
 @item QDesign Music Codec 2  @tab @tab  X

___
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] doc/general: mention some added CRI stuff

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 17 16:32:00 
2020 +0100| [1bc8c38b535e11bd350cd9c4401095bb137b6711] | committer: Paul B Mahol

doc/general: mention some added CRI stuff

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

 doc/general.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/doc/general.texi b/doc/general.texi
index 3684847ac1..f4c7fc5a9f 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -416,6 +416,8 @@ library:
 @tab Contains header with version and mode info, simplifying playback.
 @item CRI ADX   @tab X @tab X
 @tab Audio-only format used in console video games.
+@item CRI HCA   @tab   @tab X
+@tab Audio-only format used in console video games.
 @item Discworld II BMV  @tab   @tab X
 @item Interplay C93 @tab   @tab X
 @tab Used in the game Cyberia from Interplay.
@@ -572,6 +574,8 @@ library:
 @item raw aptX HD   @tab X @tab X
 @item raw Chinese AVS video @tab X @tab X
 @item raw CRI ADX   @tab X @tab X
+@item raw CRI AIX   @tab   @tab X
+@item raw CRI HCA   @tab   @tab X
 @item raw Dirac @tab X @tab X
 @item raw DNxHD @tab X @tab X
 @item raw DTS   @tab X @tab X

___
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] doc/general: mention more DPCM codecs

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 17 19:52:46 
2020 +0100| [9f75d33ac3b872a5f023271af42eb40992060cff] | committer: Paul B Mahol

doc/general: mention more DPCM codecs

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

 doc/general.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/general.texi b/doc/general.texi
index 0beab3e0d1..26c46ee428 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -1168,6 +1168,7 @@ following image formats are supported:
 @item DCA (DTS Coherent Acoustics)  @tab  X  @tab  X
 @tab supported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
 @item Dolby E  @tab @tab  X
+@item DPCM Gremlin   @tab @tab  X
 @item DPCM id RoQ@tab  X  @tab  X
 @tab Used in Quake III, Jedi Knight 2 and other computer games.
 @item DPCM Interplay @tab @tab  X
@@ -1179,6 +1180,7 @@ following image formats are supported:
 @item DPCM Sol   @tab @tab  X
 @item DPCM Xan   @tab @tab  X
 @tab Used in Origin's Wing Commander IV AVI files.
+@item DPCM Xilam DERF@tab @tab  X
 @item DSD (Direct Stream Digital), least significant bit first  @tab  @tab  X
 @item DSD (Direct Stream Digital), most significant bit first   @tab  @tab  X
 @item DSD (Direct Stream Digital), least significant bit first, planar  @tab  
@tab  X

___
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] doc/general: remove dupe entry and fix section

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 17 20:06:11 
2020 +0100| [9a2d950f96d733bbf430d323cc422ce2c20dd1fd] | committer: Paul B Mahol

doc/general: remove dupe entry and fix section

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

 doc/general.texi | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/general.texi b/doc/general.texi
index 26c46ee428..14878f4dcf 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -416,6 +416,7 @@ library:
 @tab Contains header with version and mode info, simplifying playback.
 @item CRI ADX   @tab X @tab X
 @tab Audio-only format used in console video games.
+@item CRI AIX   @tab   @tab X
 @item CRI HCA   @tab   @tab X
 @tab Audio-only format used in console video games.
 @item Discworld II BMV  @tab   @tab X
@@ -573,9 +574,6 @@ library:
 @item raw aptX  @tab X @tab X
 @item raw aptX HD   @tab X @tab X
 @item raw Chinese AVS video @tab X @tab X
-@item raw CRI ADX   @tab X @tab X
-@item raw CRI AIX   @tab   @tab X
-@item raw CRI HCA   @tab   @tab X
 @item raw Dirac @tab X @tab X
 @item raw DNxHD @tab X @tab X
 @item raw DTS   @tab X @tab X
@@ -1159,6 +1157,7 @@ following image formats are supported:
 @tab decoding supported through external library libcelt
 @item codec2 @tab  E  @tab  E
 @tab en/decoding supported through external library libcodec2
+@item CRI HCA@tab @tab X
 @item Delphine Software International CIN audio  @tab @tab  X
 @tab Codec used in Delphine Software International games.
 @item Digital Speech Standard - Standard Play mode (DSS SP) @tab @tab  X

___
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] remove CHAR_MIN/CHAR_MAX usage

2020-03-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Mar 17 22:46:36 
2020 +0100| [d64cbd4fda01c6e33e9e5e6f859e81c47bdb1760] | committer: Paul B Mahol

remove CHAR_MIN/CHAR_MAX usage

It is not needed at all.

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

 fftools/ffprobe.c| 20 ++--
 libavcodec/mpeg12enc.c   |  2 +-
 libavcodec/options_table.h   |  6 +++---
 libavcodec/proresenc_anatoliy.c  |  2 +-
 libavcodec/proresenc_kostya.c|  2 +-
 libavdevice/opengl_enc.c |  2 +-
 libavfilter/aeval.c  |  4 ++--
 libavfilter/af_pan.c |  2 +-
 libavfilter/asrc_flite.c |  8 
 libavfilter/avf_showcqt.c| 20 ++--
 libavfilter/avf_showvolume.c |  2 +-
 libavfilter/f_drawgraph.c| 18 +-
 libavfilter/src_movie.c  |  4 ++--
 libavfilter/vf_blend.c   | 10 +-
 libavfilter/vf_chromakey.c   |  4 ++--
 libavfilter/vf_colorkey.c|  4 ++--
 libavfilter/vf_colorkey_opencl.c |  2 +-
 libavfilter/vf_crop.c| 12 ++--
 libavfilter/vf_delogo.c  |  8 
 libavfilter/vf_drawbox.c | 40 
 libavfilter/vf_drawtext.c| 24 
 libavfilter/vf_eq.c  | 16 
 libavfilter/vf_fade.c|  4 ++--
 libavfilter/vf_fftfilt.c |  6 +++---
 libavfilter/vf_geq.c | 28 ++--
 libavfilter/vf_normalize.c   |  4 ++--
 libavfilter/vf_overlay.c |  4 ++--
 libavfilter/vf_pad.c | 12 ++--
 libavfilter/vf_palettegen.c  |  2 +-
 libavfilter/vf_paletteuse.c  |  2 +-
 libavfilter/vf_rotate.c  | 16 
 libavfilter/vf_selectivecolor.c  |  2 +-
 libavfilter/vf_subtitles.c   | 12 ++--
 libavfilter/vf_vpp_qsv.c |  8 
 libavfilter/vsrc_life.c  |  8 
 libavfilter/vsrc_mandelbrot.c|  8 
 libavfilter/vsrc_testsrc.c   |  4 ++--
 libavformat/avio.c   |  4 ++--
 libavformat/aviobuf.c|  2 +-
 libavformat/options_table.h  | 10 +-
 libavformat/segment.c|  2 +-
 41 files changed, 175 insertions(+), 175 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 964256c8b2..e3f221f560 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -1084,12 +1084,12 @@ typedef struct CompactContext {
 #define OFFSET(x) offsetof(CompactContext, x)
 
 static const AVOption compact_options[]= {
-{"item_sep", "set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str="|"},  CHAR_MIN, CHAR_MAX },
-{"s","set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str="|"},  CHAR_MIN, CHAR_MAX },
+{"item_sep", "set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str="|"},  0, 0 },
+{"s","set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str="|"},  0, 0 },
 {"nokey","force no key printing", OFFSET(nokey),   
AV_OPT_TYPE_BOOL,   {.i64=0},0,1},
 {"nk",   "force no key printing", OFFSET(nokey),   
AV_OPT_TYPE_BOOL,   {.i64=0},0,1},
-{"escape",   "set escape mode",   OFFSET(escape_mode_str), 
AV_OPT_TYPE_STRING, {.str="c"},  CHAR_MIN, CHAR_MAX },
-{"e","set escape mode",   OFFSET(escape_mode_str), 
AV_OPT_TYPE_STRING, {.str="c"},  CHAR_MIN, CHAR_MAX },
+{"escape",   "set escape mode",   OFFSET(escape_mode_str), 
AV_OPT_TYPE_STRING, {.str="c"},  0, 0 },
+{"e","set escape mode",   OFFSET(escape_mode_str), 
AV_OPT_TYPE_STRING, {.str="c"},  0, 0 },
 {"print_section", "print section name", OFFSET(print_section), 
AV_OPT_TYPE_BOOL,   {.i64=1},0,1},
 {"p", "print section name", OFFSET(print_section), 
AV_OPT_TYPE_BOOL,   {.i64=1},0,1},
 {NULL},
@@ -1200,12 +1200,12 @@ static const Writer compact_writer = {
 #define OFFSET(x) offsetof(CompactContext, x)
 
 static const AVOption csv_options[] = {
-{"item_sep", "set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str=","},  CHAR_MIN, CHAR_MAX },
-{"s","set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str=","},  CHAR_MIN, CHAR_MAX },
+{"item_sep", "set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str=","},  0, 0 },
+{"s","set item separator",OFFSET(item_sep_str),
AV_OPT_TYPE_STRING, {.str=","},  0, 0 },
 {"nokey","force no key printing", OFFSET(nokey),   
AV_OPT_TYPE_BOOL,   {.i64=1},0,1},
 {"nk",   "force no key printing", OFFSET(nokey),   
AV_OPT_TYPE_BOOL,   {.i64=1},0,1},
-{"escape",   "set escape mode",   OFF

[FFmpeg-cvslog] hwcontext_vulkan: fix imported image bitmask

2020-03-17 Thread Lynne
ffmpeg | branch: master | Lynne  | Tue Mar 17 13:08:06 2020 
+| [ecc3dceff44b8612c80014d45a514df882883940] | committer: Lynne

hwcontext_vulkan: fix imported image bitmask

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

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

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index f3aa1f0d8c..ed88979d0d 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1758,7 +1758,8 @@ static int 
vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
 .extent.depth  = 1,
 .mipLevels = 1,
 .arrayLayers   = 1,
-.flags = VK_IMAGE_CREATE_ALIAS_BIT | signal_p ? 
VK_IMAGE_CREATE_DISJOINT_BIT : 0x0,
+.flags = VK_IMAGE_CREATE_ALIAS_BIT |
+ (signal_p ? VK_IMAGE_CREATE_DISJOINT_BIT : 0x0),
 .tiling= f->tiling,
 .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, /* specs say so */
 .usage = DEFAULT_USAGE_FLAGS,

___
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] scale_vulkan: add support for RGB->YUV conversions

2020-03-17 Thread Lynne
ffmpeg | branch: master | Lynne  | Sun Mar 15 10:30:34 2020 
+| [1a5e9ae4d8e5ee34c983f16a280c9a262a3fbf8d] | committer: Lynne

scale_vulkan: add support for RGB->YUV conversions

Only top-left chroma position supported for now.

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

 libavfilter/vf_scale_vulkan.c | 300 +-
 libavfilter/vulkan.c  |  12 ++
 libavfilter/vulkan.h  |   5 +
 3 files changed, 254 insertions(+), 63 deletions(-)

diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c
index 1534f2d716..c5c64ae96c 100644
--- a/libavfilter/vf_scale_vulkan.c
+++ b/libavfilter/vf_scale_vulkan.c
@@ -20,6 +20,7 @@
 #include "vulkan.h"
 #include "scale_eval.h"
 #include "internal.h"
+#include "colorspace.h"
 
 #define CGROUPS (int [3]){ 32, 32, 1 }
 
@@ -36,22 +37,67 @@ typedef struct ScaleVulkanContext {
 int initialized;
 FFVkExecContext *exec;
 VulkanPipeline *pl;
+FFVkBuffer params_buf;
 
 /* Shader updators, must be in the main filter struct */
 VkDescriptorImageInfo input_images[3];
 VkDescriptorImageInfo output_images[3];
+VkDescriptorBufferInfo params_desc;
 
 enum ScalerFunc scaler;
-char *output_format_string;
+char *out_format_string;
+enum AVColorRange out_range;
 char *w_expr;
 char *h_expr;
 } ScaleVulkanContext;
 
 static const char scale_bilinear[] = {
-C(0, void scale_bilinear(int idx, ivec2 pos)   
 )
+C(0, vec4 scale_bilinear(int idx, ivec2 pos)   
 )
 C(0, { 
 )
 C(1, const vec2 npos = (vec2(pos) + 0.5f) / 
imageSize(output_img[idx]); )
-C(1, imageStore(output_img[idx], pos, texture(input_img[idx], npos));  
 )
+C(1, return texture(input_img[idx], npos); 
 )
+C(0, } 
 )
+};
+
+static const char rgb2yuv[] = {
+C(0, vec4 rgb2yuv(vec4 src, int fullrange) 
 )
+C(0, { 
 )
+C(1, src *= yuv_matrix;
 )
+C(1, if (fullrange == 1) { 
 )
+C(2, src += vec4(0.0, 0.5, 0.5, 0.0);  
 )
+C(1, } else {  
 )
+C(2, src *= vec4(219.0 / 255.0, 224.0 / 255.0, 224.0 / 255.0, 
1.0); )
+C(2, src += vec4(16.0 / 255.0, 128.0 / 255.0, 128.0 / 255.0, 0.0); 
 )
+C(1, } 
 )
+C(1, return src;   
 )
+C(0, } 
 )
+};
+
+static const char write_nv12[] = {
+C(0, void write_nv12(vec4 src, ivec2 pos)  
 )
+C(0, { 
 )
+C(1, imageStore(output_img[0], pos, vec4(src.r, 0.0, 0.0, 0.0));   
 )
+C(1, pos /= ivec2(2);  
 )
+C(1, imageStore(output_img[1], pos, vec4(src.g, src.b, 0.0, 0.0)); 
 )
+C(0, } 
 )
+};
+
+static const char write_420[] = {
+C(0, void write_420(vec4 src, ivec2 pos)   
 )
+C(0, { 
 )
+C(1, imageStore(output_img[0], pos, vec4(src.r, 0.0, 0.0, 0.0));   
 )
+C(1, pos /= ivec2(2);  
 )
+C(1, imageStore(output_img[1], pos, vec4(src.g, 0.0, 0.0, 0.0));   
 )
+C(1, imageStore(output_img[2], pos, vec4(src.b, 0.0, 0.0, 0.0));   
 )
+C(0, } 
 )
+};
+
+static const char write_444[] = {
+C(0, void write_444(vec4 src, ivec2 pos)   
 )
+C(0, { 
 )
+C(1, imageStore(output_img[0], pos, vec4(src.r, 0.0, 0.0, 0.0));   
 )
+C(1, imageStore(output_img[1], pos, vec4(src.g, 0.0, 0.0, 0.0));   
 )
+C(1, imageStore(output_img[2], pos, vec4(src.b, 0.0, 0.0, 0.0));   
 )
 C(0, } 
 )
 };
 
@@ -103,6 +149,16 @@ static av_cold int init_filter(AVFilterContext *ctx, 
AVFrame *in)
 },
 };
 
+VulkanDescriptorSetBinding desc_b = {
+.name= "params",
+.type= VK_DESCRIPTOR_TY

[FFmpeg-cvslog] avcodec/avcodec: Fix typos

2020-03-17 Thread Andriy Gelman
ffmpeg | branch: master | Andriy Gelman  | Thu Mar  5 
00:02:27 2020 -0500| [1e3d4fa0fb6d98cb55a8e721021be58185aa7c25] | committer: 
James Almer

avcodec/avcodec: Fix typos

Signed-off-by: Andriy Gelman 
Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6e03cb5902..78c483c25c 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -5047,7 +5047,7 @@ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame 
*frame);
  *  AVERROR(EINVAL):   codec not opened, refcounted_frames not set, it is a
  * decoder, or requires flush
  *  AVERROR(ENOMEM):   failed to add packet to internal queue, or similar
- *  other errors: legitimate decoding errors
+ *  other errors: legitimate encoding errors
  */
 int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);
 
@@ -5063,8 +5063,8 @@ int avcodec_send_frame(AVCodecContext *avctx, const 
AVFrame *frame);
  * must try to send input
  *  AVERROR_EOF:   the encoder has been fully flushed, and there will 
be
  * no more output packets
- *  AVERROR(EINVAL):   codec not opened, or it is an encoder
- *  other errors: legitimate decoding errors
+ *  AVERROR(EINVAL):   codec not opened, or it is a decoder
+ *  other errors: legitimate encoding errors
  */
 int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt);
 

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