* [FFmpeg-devel] [PATCH] QOA decoding support
@ 2023-09-23 21:39 Paul B Mahol
2023-09-24 0:05 ` Andreas Rheinhardt
2023-09-24 0:50 ` Paul B Mahol
0 siblings, 2 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-09-23 21:39 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 18 bytes --]
Patches attached.
[-- Attachment #2: 0002-avcodec-add-QOA-decoder-and-parser.patch --]
[-- Type: text/x-patch, Size: 13009 bytes --]
From 5d57a04d3b4aa9b487302ab89b2a3bca4ccb9330 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 23 Sep 2023 16:49:25 +0200
Subject: [PATCH 2/2] avcodec: add QOA decoder and parser
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavcodec/Makefile | 2 +
libavcodec/allcodecs.c | 1 +
libavcodec/codec_desc.c | 7 ++
libavcodec/codec_id.h | 1 +
libavcodec/parsers.c | 1 +
libavcodec/qoa_parser.c | 89 +++++++++++++++++++++
libavcodec/qoadec.c | 170 ++++++++++++++++++++++++++++++++++++++++
7 files changed, 271 insertions(+)
create mode 100644 libavcodec/qoa_parser.c
create mode 100644 libavcodec/qoadec.c
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a1eb83f92d..c70d27a5c8 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -623,6 +623,7 @@ OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o \
OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o
OBJS-$(CONFIG_QDMC_DECODER) += qdmc.o
OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o
+OBJS-$(CONFIG_QOA_DECODER) += qoadec.o
OBJS-$(CONFIG_QOI_DECODER) += qoidec.o
OBJS-$(CONFIG_QOI_ENCODER) += qoienc.o
OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
@@ -1205,6 +1206,7 @@ OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \
vorbis_data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
+OBJS-$(CONFIG_QOA_PARSER) += qoa_parser.o
OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o
OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o
OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 4ea6515c6c..86d0972742 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -523,6 +523,7 @@ extern const FFCodec ff_paf_audio_decoder;
extern const FFCodec ff_qcelp_decoder;
extern const FFCodec ff_qdm2_decoder;
extern const FFCodec ff_qdmc_decoder;
+extern const FFCodec ff_qoa_decoder;
extern const FFCodec ff_ra_144_encoder;
extern const FFCodec ff_ra_144_decoder;
extern const FFCodec ff_ra_288_decoder;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 3ddd2fd3ee..fe838b49cb 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3434,6 +3434,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Sonarc (Speech Compression)"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
+ {
+ .id = AV_CODEC_ID_QOA,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "qoa",
+ .long_name = NULL_IF_CONFIG_SMALL("QOA (Quite OK Audio)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
/* subtitle codecs */
{
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 73352f5461..c313536f7b 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -546,6 +546,7 @@ enum AVCodecID {
AV_CODEC_ID_AC4,
AV_CODEC_ID_OSQ,
AV_CODEC_ID_SONARC,
+ AV_CODEC_ID_QOA,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index 5128009cd4..2ed96120f1 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -65,6 +65,7 @@ extern const AVCodecParser ff_mpegvideo_parser;
extern const AVCodecParser ff_opus_parser;
extern const AVCodecParser ff_png_parser;
extern const AVCodecParser ff_pnm_parser;
+extern const AVCodecParser ff_qoa_parser;
extern const AVCodecParser ff_qoi_parser;
extern const AVCodecParser ff_rv34_parser;
extern const AVCodecParser ff_sbc_parser;
diff --git a/libavcodec/qoa_parser.c b/libavcodec/qoa_parser.c
new file mode 100644
index 0000000000..0e5537a326
--- /dev/null
+++ b/libavcodec/qoa_parser.c
@@ -0,0 +1,89 @@
+/*
+ * QOA parser
+ *
+ * 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 "parser.h"
+
+typedef struct QOAParseContext {
+ ParseContext pc;
+ int frame_size;
+ int remaining;
+ int duration;
+} QOAParseContext;
+
+static int qoa_parse(AVCodecParserContext *s, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+ QOAParseContext *qoa = s->priv_data;
+ uint64_t state = qoa->pc.state64;
+ int next = END_NOT_FOUND, i = 0;
+
+ *poutbuf_size = 0;
+ *poutbuf = NULL;
+
+ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+ next = buf_size;
+ } else {
+ if (!qoa->frame_size) {
+ for (; i < buf_size; i++) {
+ state = (state << 8) | buf[i];
+ if (((state & 0xFFFF) > 0 && (state >> 56))) {
+ qoa->frame_size = state & 0xFFFF;
+ qoa->duration = (state >> 16) & 0xFFFF;
+ break;
+ }
+ }
+ }
+
+ if (qoa->frame_size) {
+ if (!qoa->remaining)
+ qoa->remaining = qoa->frame_size;
+ if (qoa->remaining <= buf_size) {
+ next = qoa->remaining;
+ qoa->remaining = 0;
+ qoa->frame_size = 0;
+ state = 0;
+ } else {
+ qoa->remaining -= buf_size;
+ }
+ }
+
+ qoa->pc.state64 = state;
+ if (ff_combine_frame(&qoa->pc, next, &buf, &buf_size) < 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
+
+ s->duration = qoa->duration;
+ }
+
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+
+ return next;
+}
+
+const AVCodecParser ff_qoa_parser = {
+ .codec_ids = { AV_CODEC_ID_QOA },
+ .priv_data_size = sizeof(QOAParseContext),
+ .parser_parse = qoa_parse,
+ .parser_close = ff_parse_close,
+};
diff --git a/libavcodec/qoadec.c b/libavcodec/qoadec.c
new file mode 100644
index 0000000000..c1072754c8
--- /dev/null
+++ b/libavcodec/qoadec.c
@@ -0,0 +1,170 @@
+/*
+ * QOA decoder
+ *
+ * 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 "avcodec.h"
+#include "codec_internal.h"
+#include "decode.h"
+#include "get_bits.h"
+#include "bytestream.h"
+
+#define QOA_SLICE_LEN 20
+#define QOA_LMS_LEN 4
+
+typedef struct QOAChannel {
+ int history[QOA_LMS_LEN];
+ int weights[QOA_LMS_LEN];
+} QOAChannel;
+
+typedef struct QOAContext {
+ QOAChannel *ch;
+} QOAContext;
+
+static const int16_t qoa_dequant_tab[16][8] = {
+ { 1, -1, 3, -3, 5, -5, 7, -7},
+ { 5, -5, 18, -18, 32, -32, 49, -49},
+ { 16, -16, 53, -53, 95, -95, 147, -147},
+ { 34, -34, 113, -113, 203, -203, 315, -315},
+ { 63, -63, 210, -210, 378, -378, 588, -588},
+ { 104, -104, 345, -345, 621, -621, 966, -966},
+ { 158, -158, 528, -528, 950, -950, 1477, -1477},
+ { 228, -228, 760, -760, 1368, -1368, 2128, -2128},
+ { 316, -316, 1053, -1053, 1895, -1895, 2947, -2947},
+ { 422, -422, 1405, -1405, 2529, -2529, 3934, -3934},
+ { 548, -548, 1828, -1828, 3290, -3290, 5117, -5117},
+ { 696, -696, 2320, -2320, 4176, -4176, 6496, -6496},
+ { 868, -868, 2893, -2893, 5207, -5207, 8099, -8099},
+ {1064, -1064, 3548, -3548, 6386, -6386, 9933, -9933},
+ {1286, -1286, 4288, -4288, 7718, -7718, 12005, -12005},
+ {1536, -1536, 5120, -5120, 9216, -9216, 14336, -14336},
+};
+
+static av_cold int qoa_decode_init(AVCodecContext *avctx)
+{
+ QOAContext *s = avctx->priv_data;
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ s->ch = av_calloc(avctx->ch_layout.nb_channels, sizeof(*s->ch));
+ if (!s->ch)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static int qoa_lms_predict(QOAChannel *lms)
+{
+ int prediction = 0;
+ for (int i = 0; i < QOA_LMS_LEN; i++)
+ prediction += lms->weights[i] * lms->history[i];
+ return prediction >> 13;
+}
+
+static void qoa_lms_update(QOAChannel *lms, int sample, int residual)
+{
+ int delta = residual >> 4;
+ for (int i = 0; i < QOA_LMS_LEN; i++)
+ lms->weights[i] += lms->history[i] < 0 ? -delta : delta;
+ for (int i = 0; i < QOA_LMS_LEN-1; i++)
+ lms->history[i] = lms->history[i+1];
+ lms->history[QOA_LMS_LEN-1] = sample;
+}
+
+static int qoa_decode_frame(AVCodecContext *avctx, AVFrame *frame,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ QOAContext *s = avctx->priv_data;
+ int ret, frame_size, nb_channels;
+ GetByteContext gb;
+ int16_t *samples;
+
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
+ avctx->ch_layout.nb_channels = nb_channels = bytestream2_get_byte(&gb);
+ avctx->sample_rate = bytestream2_get_be24(&gb);
+ frame->nb_samples = bytestream2_get_be16(&gb);
+ frame_size = bytestream2_get_be16(&gb);
+ if (frame_size > avpkt->size)
+ return AVERROR_INVALIDDATA;
+
+ if (frame_size < 8 + QOA_LMS_LEN * 4 * nb_channels)
+ return AVERROR_INVALIDDATA;
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+ samples = (int16_t *)frame->data[0];
+
+ for (int ch = 0; ch < nb_channels; ch++) {
+ QOAChannel *qch = &s->ch[ch];
+
+ for (int n = 0; n < QOA_LMS_LEN; n++)
+ qch->history[n] = sign_extend(bytestream2_get_be16(&gb), 16);
+ for (int n = 0; n < QOA_LMS_LEN; n++)
+ qch->weights[n] = sign_extend(bytestream2_get_be16(&gb), 16);
+ }
+
+ for (int sample_index = 0; sample_index < frame->nb_samples * nb_channels;
+ sample_index += QOA_SLICE_LEN) {
+ for (int ch = 0; ch < nb_channels; ch++) {
+ QOAChannel *lms = &s->ch[ch];
+ uint64_t slice = bytestream2_get_be64u(&gb);
+ int scalefactor = (slice >> 60) & 0xf;
+ int slice_start = sample_index * nb_channels + ch;
+ int slice_end = av_clip(sample_index + QOA_SLICE_LEN, 0, frame->nb_samples) * nb_channels + ch;
+
+ for (int si = slice_start; si < slice_end; si += nb_channels) {
+ int predicted = qoa_lms_predict(lms);
+ int quantized = (slice >> 57) & 0x7;
+ int dequantized = qoa_dequant_tab[scalefactor][quantized];
+ int reconstructed = av_clip_int16(predicted + dequantized);
+
+ samples[si] = reconstructed;
+ slice <<= 3;
+
+ qoa_lms_update(lms, reconstructed, dequantized);
+ }
+ }
+ }
+
+ *got_frame_ptr = 1;
+
+ return avpkt->size;
+}
+
+static av_cold int qoa_decode_end(AVCodecContext *avctx)
+{
+ QOAContext *s = avctx->priv_data;
+ av_freep(&s->ch);
+ return 0;
+}
+
+const FFCodec ff_qoa_decoder = {
+ .p.name = "qoa",
+ CODEC_LONG_NAME("QOA (Quite OK Audio)"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_QOA,
+ .priv_data_size = sizeof(QOAContext),
+ .init = qoa_decode_init,
+ FF_CODEC_DECODE_CB(qoa_decode_frame),
+ .close = qoa_decode_end,
+ .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
+ AV_CODEC_CAP_DR1,
+ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
+ AV_SAMPLE_FMT_NONE },
+};
--
2.42.0
[-- Attachment #3: 0001-avformat-add-QOA-demuxer.patch --]
[-- Type: text/x-patch, Size: 4429 bytes --]
From 1bf5a9170745cdcf25df9e144fd31bb172afdbd1 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 23 Sep 2023 16:38:35 +0200
Subject: [PATCH 1/2] avformat: add QOA demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
libavformat/qoadec.c | 83 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 libavformat/qoadec.c
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 329055ccfd..2db83aff81 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -484,6 +484,7 @@ OBJS-$(CONFIG_PP_BNK_DEMUXER) += pp_bnk.o
OBJS-$(CONFIG_PVA_DEMUXER) += pva.o
OBJS-$(CONFIG_PVF_DEMUXER) += pvfdec.o pcm.o
OBJS-$(CONFIG_QCP_DEMUXER) += qcp.o
+OBJS-$(CONFIG_QOA_DEMUXER) += qoadec.o
OBJS-$(CONFIG_R3D_DEMUXER) += r3d.o
OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += rawvideodec.o
OBJS-$(CONFIG_RAWVIDEO_MUXER) += rawenc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index d4b505a5a3..c8bb4e3866 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -383,6 +383,7 @@ extern const FFOutputFormat ff_psp_muxer;
extern const AVInputFormat ff_pva_demuxer;
extern const AVInputFormat ff_pvf_demuxer;
extern const AVInputFormat ff_qcp_demuxer;
+extern const AVInputFormat ff_qoa_demuxer;
extern const AVInputFormat ff_r3d_demuxer;
extern const AVInputFormat ff_rawvideo_demuxer;
extern const FFOutputFormat ff_rawvideo_muxer;
diff --git a/libavformat/qoadec.c b/libavformat/qoadec.c
new file mode 100644
index 0000000000..228e08cee8
--- /dev/null
+++ b/libavformat/qoadec.c
@@ -0,0 +1,83 @@
+/*
+ * QOA demuxer
+ *
+ * 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 "avformat.h"
+#include "avio_internal.h"
+#include "internal.h"
+#include "rawdec.h"
+#include "libavutil/intreadwrite.h"
+
+static int qoa_probe(const AVProbeData *p)
+{
+ if ((p->buf_size < 16) ||
+ (AV_RB32(p->buf) != MKBETAG('q','o','a','f')) ||
+ (AV_RB32(p->buf + 4) == 0) ||
+ (p->buf[8] == 0) ||
+ (AV_RB24(p->buf + 9) == 0) ||
+ (AV_RB16(p->buf + 12) == 0) ||
+ (AV_RB16(p->buf + 14) == 0))
+ return 0;
+ return AVPROBE_SCORE_MAX;
+}
+
+static int qoa_read_header(AVFormatContext *s)
+{
+ AVIOContext *pb = s->pb;
+ AVStream *st;
+
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ avio_skip(pb, 4);
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_QOA;
+ ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
+ st->duration = avio_rb32(pb);
+ st->start_time = 0;
+
+ ffio_ensure_seekback(pb, 4);
+ st->codecpar->ch_layout.nb_channels = avio_r8(pb);
+ if (st->codecpar->ch_layout.nb_channels == 0)
+ return AVERROR_INVALIDDATA;
+
+ st->codecpar->sample_rate = avio_rb24(pb);
+ if (st->codecpar->sample_rate == 0)
+ return AVERROR_INVALIDDATA;
+
+ avio_seek(pb, -4, SEEK_CUR);
+
+ avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
+
+ return 0;
+}
+
+const AVInputFormat ff_qoa_demuxer = {
+ .name = "qoa",
+ .long_name = NULL_IF_CONFIG_SMALL("raw QOA"),
+ .read_probe = qoa_probe,
+ .read_header = qoa_read_header,
+ .read_packet = ff_raw_read_partial_packet,
+ .flags = AVFMT_GENERIC_INDEX,
+ .extensions = "qoa",
+ .raw_codec_id = AV_CODEC_ID_QOA,
+ .priv_data_size = sizeof(FFRawDemuxerContext),
+ .priv_class = &ff_raw_demuxer_class,
+};
--
2.42.0
[-- Attachment #4: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-23 21:39 [FFmpeg-devel] [PATCH] QOA decoding support Paul B Mahol
@ 2023-09-24 0:05 ` Andreas Rheinhardt
2023-09-24 0:48 ` Paul B Mahol
2023-09-24 0:50 ` Paul B Mahol
1 sibling, 1 reply; 21+ messages in thread
From: Andreas Rheinhardt @ 2023-09-24 0:05 UTC (permalink / raw)
To: ffmpeg-devel
Paul B Mahol:
> + .flags = AVFMT_GENERIC_INDEX,
> + .extensions = "qoa",
> + .raw_codec_id = AV_CODEC_ID_QOA,
This will not compile: The codec_id is only added in the second patch.
> + .priv_data_size = sizeof(FFRawDemuxerContext),
> + .priv_class = &ff_raw_demuxer_class,
>
> + if (!qoa->frame_size) {
> + for (; i < buf_size; i++) {
> + state = (state << 8) | buf[i];
> + if (((state & 0xFFFF) > 0 && (state >> 56))) {
> + qoa->frame_size = state & 0xFFFF;
> + qoa->duration = (state >> 16) & 0xFFFF;
> + break;
> + }
> + }
> + }
So this codec uses a length field. In this case it is quite simple to
avoid the parser (and its implicit memcpy) altogether and just make the
demuxer directly output packets of the correct size. This is quite
natural given that this format does not seem to provide any features
like resyncing support (or at least the parser does not implement them).
>
> +#include "avcodec.h"
> +#include "codec_internal.h"
> +#include "decode.h"
> +#include "get_bits.h"
You don't use the GetBit API at all.
> +#include "bytestream.h"
>
> + for (int sample_index = 0; sample_index < frame->nb_samples * nb_channels;
> + sample_index += QOA_SLICE_LEN) {
> + for (int ch = 0; ch < nb_channels; ch++) {
So the number of times the second loop is executed is quadratic in
nb_channels. Is this really intended? The frame_size check is not
quadratic in nb_channels. In fact, it does not seem to account for this
double-loop here at all.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-24 0:05 ` Andreas Rheinhardt
@ 2023-09-24 0:48 ` Paul B Mahol
2023-09-27 12:52 ` Andreas Rheinhardt
0 siblings, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-24 0:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sun, Sep 24, 2023 at 2:04 AM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:
> Paul B Mahol:
> > + .flags = AVFMT_GENERIC_INDEX,
> > + .extensions = "qoa",
> > + .raw_codec_id = AV_CODEC_ID_QOA,
>
> This will not compile: The codec_id is only added in the second patch.
>
> > + .priv_data_size = sizeof(FFRawDemuxerContext),
> > + .priv_class = &ff_raw_demuxer_class,
>
>
> >
> > + if (!qoa->frame_size) {
> > + for (; i < buf_size; i++) {
> > + state = (state << 8) | buf[i];
> > + if (((state & 0xFFFF) > 0 && (state >> 56))) {
> > + qoa->frame_size = state & 0xFFFF;
> > + qoa->duration = (state >> 16) & 0xFFFF;
> > + break;
> > + }
> > + }
> > + }
>
> So this codec uses a length field. In this case it is quite simple to
> avoid the parser (and its implicit memcpy) altogether and just make the
> demuxer directly output packets of the correct size. This is quite
> natural given that this format does not seem to provide any features
> like resyncing support (or at least the parser does not implement them).
>
But channels/sample rate may differ between packets.
Also it may be in other formats, like wav. So I picked parser as more
valuable implementation.
>
> >
> > +#include "avcodec.h"
> > +#include "codec_internal.h"
> > +#include "decode.h"
> > +#include "get_bits.h"
>
> You don't use the GetBit API at all.
>
> > +#include "bytestream.h"
>
> >
> > + for (int sample_index = 0; sample_index < frame->nb_samples *
> nb_channels;
> > + sample_index += QOA_SLICE_LEN) {
> > + for (int ch = 0; ch < nb_channels; ch++) {
>
> So the number of times the second loop is executed is quadratic in
> nb_channels. Is this really intended? The frame_size check is not
> quadratic in nb_channels. In fact, it does not seem to account for this
> double-loop here at all.
>
> - Andreas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-24 0:48 ` Paul B Mahol
@ 2023-09-27 12:52 ` Andreas Rheinhardt
2023-09-27 12:52 ` Paul B Mahol
2023-09-27 12:58 ` Nicolas George
0 siblings, 2 replies; 21+ messages in thread
From: Andreas Rheinhardt @ 2023-09-27 12:52 UTC (permalink / raw)
To: ffmpeg-devel
Paul B Mahol:
> On Sun, Sep 24, 2023 at 2:04 AM Andreas Rheinhardt <
> andreas.rheinhardt@outlook.com> wrote:
>
>> Paul B Mahol:
>>>
>>> + if (!qoa->frame_size) {
>>> + for (; i < buf_size; i++) {
>>> + state = (state << 8) | buf[i];
>>> + if (((state & 0xFFFF) > 0 && (state >> 56))) {
>>> + qoa->frame_size = state & 0xFFFF;
>>> + qoa->duration = (state >> 16) & 0xFFFF;
>>> + break;
>>> + }
>>> + }
>>> + }
>>
>> So this codec uses a length field. In this case it is quite simple to
>> avoid the parser (and its implicit memcpy) altogether and just make the
>> demuxer directly output packets of the correct size. This is quite
>> natural given that this format does not seem to provide any features
>> like resyncing support (or at least the parser does not implement them).
>>
>
> But channels/sample rate may differ between packets.
And?
> Also it may be in other formats, like wav. So I picked parser as more
> valuable implementation.
>
Then you could simply reuse the code inside libavformat.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:52 ` Andreas Rheinhardt
@ 2023-09-27 12:52 ` Paul B Mahol
2023-09-27 12:57 ` Nicolas George
2023-09-27 12:58 ` Nicolas George
1 sibling, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 12:52 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 2:51 PM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:
> Paul B Mahol:
> > On Sun, Sep 24, 2023 at 2:04 AM Andreas Rheinhardt <
> > andreas.rheinhardt@outlook.com> wrote:
> >
> >> Paul B Mahol:
> >>>
> >>> + if (!qoa->frame_size) {
> >>> + for (; i < buf_size; i++) {
> >>> + state = (state << 8) | buf[i];
> >>> + if (((state & 0xFFFF) > 0 && (state >> 56))) {
> >>> + qoa->frame_size = state & 0xFFFF;
> >>> + qoa->duration = (state >> 16) & 0xFFFF;
> >>> + break;
> >>> + }
> >>> + }
> >>> + }
> >>
> >> So this codec uses a length field. In this case it is quite simple to
> >> avoid the parser (and its implicit memcpy) altogether and just make the
> >> demuxer directly output packets of the correct size. This is quite
> >> natural given that this format does not seem to provide any features
> >> like resyncing support (or at least the parser does not implement them).
> >>
> >
> > But channels/sample rate may differ between packets.
>
> And?
>
> > Also it may be in other formats, like wav. So I picked parser as more
> > valuable implementation.
> >
>
> Then you could simply reuse the code inside libavformat.
>
What code?
I think that having parser is much more useful.
>
> - Andreas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:52 ` Paul B Mahol
@ 2023-09-27 12:57 ` Nicolas George
2023-09-27 13:00 ` Paul B Mahol
2023-09-27 13:02 ` Paul B Mahol
0 siblings, 2 replies; 21+ messages in thread
From: Nicolas George @ 2023-09-27 12:57 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Paul B Mahol (12023-09-27):
> I think that having parser is much more useful.
Having a parser when it can be done without is a waste of code and
resources.
Do not push like that.
--
Nicolas George
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:57 ` Nicolas George
@ 2023-09-27 13:00 ` Paul B Mahol
2023-09-27 18:37 ` Michael Niedermayer
2023-09-27 13:02 ` Paul B Mahol
1 sibling, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 13:00 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 2:57 PM Nicolas George <george@nsup.org> wrote:
> Paul B Mahol (12023-09-27):
> > I think that having parser is much more useful.
>
> Having a parser when it can be done without is a waste of code and
> resources.
>
> Do not push like that.
>
As you never pushed anything marginally useful to codebase, I'm free to
ignore your
destructive and evil inputs/comments.
>
> --
> Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 13:00 ` Paul B Mahol
@ 2023-09-27 18:37 ` Michael Niedermayer
2023-09-27 19:59 ` Paul B Mahol
0 siblings, 1 reply; 21+ messages in thread
From: Michael Niedermayer @ 2023-09-27 18:37 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: cc
[-- Attachment #1.1: Type: text/plain, Size: 1832 bytes --]
On Wed, Sep 27, 2023 at 03:00:35PM +0200, Paul B Mahol wrote:
> On Wed, Sep 27, 2023 at 2:57 PM Nicolas George <george@nsup.org> wrote:
>
> > Paul B Mahol (12023-09-27):
> > > I think that having parser is much more useful.
> >
> > Having a parser when it can be done without is a waste of code and
> > resources.
> >
> > Do not push like that.
> >
>
> As you never pushed anything marginally useful to codebase, I'm free to
6 Code of Conduct
Be friendly and respectful towards others and third parties. Treat others the way you yourself want to be treated.
Be considerate. Not everyone shares the same viewpoint and priorities as you do. Different opinions and interpretations help the project. Looking at issues from a different perspective assists development.
Do not assume malice for things that can be attributed to incompetence. Even if it is malice, it’s rarely good to start with that as initial assumption.
Stay friendly even if someone acts contrarily. Everyone has a bad day once in a while. If you yourself have a bad day or are angry then try to take a break and reply once you are calm and without anger if you have to.
Try to help other team members and cooperate if you can.
The goal of software development is to create technical excellence, not for any individual to be better and "win" against the others. Large software projects are only possible and successful through teamwork.
If someone struggles do not put them down. Give them a helping hand instead and point them in the right direction.
Finally, keep in mind the immortal words of Bill and Ted, "Be excellent to each other."
Thank you
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 18:37 ` Michael Niedermayer
@ 2023-09-27 19:59 ` Paul B Mahol
2023-10-06 11:54 ` Paul B Mahol
0 siblings, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 19:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: cc
On 9/27/23, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Wed, Sep 27, 2023 at 03:00:35PM +0200, Paul B Mahol wrote:
>> On Wed, Sep 27, 2023 at 2:57 PM Nicolas George <george@nsup.org> wrote:
>>
>> > Paul B Mahol (12023-09-27):
>> > > I think that having parser is much more useful.
>> >
>> > Having a parser when it can be done without is a waste of code and
>> > resources.
>> >
>> > Do not push like that.
>> >
>>
>> As you never pushed anything marginally useful to codebase, I'm free to
>
> 6 Code of Conduct
> Be friendly and respectful towards others and third parties. Treat others
> the way you yourself want to be treated.
> Be considerate. Not everyone shares the same viewpoint and priorities as you
> do. Different opinions and interpretations help the project. Looking at
> issues from a different perspective assists development.
> Do not assume malice for things that can be attributed to incompetence. Even
> if it is malice, it’s rarely good to start with that as initial assumption.
> Stay friendly even if someone acts contrarily. Everyone has a bad day once
> in a while. If you yourself have a bad day or are angry then try to take a
> break and reply once you are calm and without anger if you have to.
> Try to help other team members and cooperate if you can.
> The goal of software development is to create technical excellence, not for
> any individual to be better and "win" against the others. Large software
> projects are only possible and successful through teamwork.
> If someone struggles do not put them down. Give them a helping hand instead
> and point them in the right direction.
> Finally, keep in mind the immortal words of Bill and Ted, "Be excellent to
> each other."
>
> Thank you
Thanks, will push patch set in next 12h.
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The greatest way to live with honor in this world is to be what we pretend
> to be. -- Socrates
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 19:59 ` Paul B Mahol
@ 2023-10-06 11:54 ` Paul B Mahol
0 siblings, 0 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-10-06 11:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 9/27/23, Paul B Mahol <onemda@gmail.com> wrote:
> On 9/27/23, Michael Niedermayer <michael@niedermayer.cc> wrote:
>> On Wed, Sep 27, 2023 at 03:00:35PM +0200, Paul B Mahol wrote:
>>> On Wed, Sep 27, 2023 at 2:57 PM Nicolas George <george@nsup.org> wrote:
>>>
>>> > Paul B Mahol (12023-09-27):
>>> > > I think that having parser is much more useful.
>>> >
>>> > Having a parser when it can be done without is a waste of code and
>>> > resources.
>>> >
>>> > Do not push like that.
>>> >
>>>
>>> As you never pushed anything marginally useful to codebase, I'm free to
>>
>> 6 Code of Conduct
>> Be friendly and respectful towards others and third parties. Treat others
>> the way you yourself want to be treated.
>> Be considerate. Not everyone shares the same viewpoint and priorities as
>> you
>> do. Different opinions and interpretations help the project. Looking at
>> issues from a different perspective assists development.
>> Do not assume malice for things that can be attributed to incompetence.
>> Even
>> if it is malice, it’s rarely good to start with that as initial
>> assumption.
>> Stay friendly even if someone acts contrarily. Everyone has a bad day
>> once
>> in a while. If you yourself have a bad day or are angry then try to take
>> a
>> break and reply once you are calm and without anger if you have to.
>> Try to help other team members and cooperate if you can.
>> The goal of software development is to create technical excellence, not
>> for
>> any individual to be better and "win" against the others. Large software
>> projects are only possible and successful through teamwork.
>> If someone struggles do not put them down. Give them a helping hand
>> instead
>> and point them in the right direction.
>> Finally, keep in mind the immortal words of Bill and Ted, "Be excellent
>> to
>> each other."
>>
>> Thank you
>
> Thanks, will push patch set in next 12h.
>
Oh, forgot to push, pushing soon.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:57 ` Nicolas George
2023-09-27 13:00 ` Paul B Mahol
@ 2023-09-27 13:02 ` Paul B Mahol
1 sibling, 0 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 13:02 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 2:57 PM Nicolas George <george@nsup.org> wrote:
> Paul B Mahol (12023-09-27):
> > I think that having parser is much more useful.
>
> Having a parser when it can be done without is a waste of code and
> resources.
>
I already wrote that parser is useful addition. Mainly because of many
factors.
Once you understand how demuxer/parsers/decoders works together and also
understand whole Multimedia architecture in FFmpeg you will post more
valuable reviews and/or comments,
and be more useful contributor to project.
>
> Do not push like that.
>
> --
> Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:52 ` Andreas Rheinhardt
2023-09-27 12:52 ` Paul B Mahol
@ 2023-09-27 12:58 ` Nicolas George
2023-09-27 13:05 ` Andreas Rheinhardt
1 sibling, 1 reply; 21+ messages in thread
From: Nicolas George @ 2023-09-27 12:58 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Andreas Rheinhardt (12023-09-27):
> Then you could simply reuse the code inside libavformat.
Do you finally support merging the libraries then?
Because otherwise, using from libavformat code for an individual
component of libavcodec requires adding a new avpriv function.
Regards,
--
Nicolas George
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:58 ` Nicolas George
@ 2023-09-27 13:05 ` Andreas Rheinhardt
2023-09-27 13:09 ` Paul B Mahol
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Rheinhardt @ 2023-09-27 13:05 UTC (permalink / raw)
To: ffmpeg-devel
Nicolas George:
> Andreas Rheinhardt (12023-09-27):
>> Then you could simply reuse the code inside libavformat.
>
> Do you finally support merging the libraries then?
>
> Because otherwise, using from libavformat code for an individual
> component of libavcodec requires adding a new avpriv function.
>
What I meant was: He shall write a simple function which reads from the
input, determines the size of the packet, allocates and reads the actual
packet (thereby avoiding memcpy's) and sets the codec parameters based
upon the input (changes may need to be propagated via side-data
updates). This is supposed to do what the parser does and it is supposed
to stay completely inside libavformat to be reused by e.g. the Wav
demuxer if needed. There is no need for a separate copy of this code
inside libavcodec, so whether the libraries are split or not is
irrelevant here.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 13:05 ` Andreas Rheinhardt
@ 2023-09-27 13:09 ` Paul B Mahol
0 siblings, 0 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 13:09 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 3:04 PM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:
> Nicolas George:
> > Andreas Rheinhardt (12023-09-27):
> >> Then you could simply reuse the code inside libavformat.
> >
> > Do you finally support merging the libraries then?
> >
> > Because otherwise, using from libavformat code for an individual
> > component of libavcodec requires adding a new avpriv function.
> >
>
> What I meant was: He shall write a simple function which reads from the
> input, determines the size of the packet, allocates and reads the actual
> packet (thereby avoiding memcpy's) and sets the codec parameters based
> upon the input (changes may need to be propagated via side-data
> updates). This is supposed to do what the parser does and it is supposed
> to stay completely inside libavformat to be reused by e.g. the Wav
> demuxer if needed. There is no need for a separate copy of this code
> inside libavcodec, so whether the libraries are split or not is
> irrelevant here.
>
How many demuxer and/or decoders have you wrote as of today? 0/0.
So you do not know what you talk about.
I never block your intrusive changes and I could on same principles like
you can mine and be much
less kind and forgetting like you too.
> - Andreas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-23 21:39 [FFmpeg-devel] [PATCH] QOA decoding support Paul B Mahol
2023-09-24 0:05 ` Andreas Rheinhardt
@ 2023-09-24 0:50 ` Paul B Mahol
2023-09-27 12:44 ` Paul B Mahol
2023-09-27 12:54 ` Tomas Härdin
1 sibling, 2 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-09-24 0:50 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 13 bytes --]
New patches.
[-- Attachment #2: 0002-avformat-add-QOA-demuxer.patch --]
[-- Type: text/x-patch, Size: 4429 bytes --]
From 63392e60c7106bfcc6dec5fe45a9dd38f4c29e10 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 23 Sep 2023 16:38:35 +0200
Subject: [PATCH 2/2] avformat: add QOA demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
libavformat/qoadec.c | 83 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 libavformat/qoadec.c
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 329055ccfd..2db83aff81 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -484,6 +484,7 @@ OBJS-$(CONFIG_PP_BNK_DEMUXER) += pp_bnk.o
OBJS-$(CONFIG_PVA_DEMUXER) += pva.o
OBJS-$(CONFIG_PVF_DEMUXER) += pvfdec.o pcm.o
OBJS-$(CONFIG_QCP_DEMUXER) += qcp.o
+OBJS-$(CONFIG_QOA_DEMUXER) += qoadec.o
OBJS-$(CONFIG_R3D_DEMUXER) += r3d.o
OBJS-$(CONFIG_RAWVIDEO_DEMUXER) += rawvideodec.o
OBJS-$(CONFIG_RAWVIDEO_MUXER) += rawenc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index d4b505a5a3..c8bb4e3866 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -383,6 +383,7 @@ extern const FFOutputFormat ff_psp_muxer;
extern const AVInputFormat ff_pva_demuxer;
extern const AVInputFormat ff_pvf_demuxer;
extern const AVInputFormat ff_qcp_demuxer;
+extern const AVInputFormat ff_qoa_demuxer;
extern const AVInputFormat ff_r3d_demuxer;
extern const AVInputFormat ff_rawvideo_demuxer;
extern const FFOutputFormat ff_rawvideo_muxer;
diff --git a/libavformat/qoadec.c b/libavformat/qoadec.c
new file mode 100644
index 0000000000..228e08cee8
--- /dev/null
+++ b/libavformat/qoadec.c
@@ -0,0 +1,83 @@
+/*
+ * QOA demuxer
+ *
+ * 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 "avformat.h"
+#include "avio_internal.h"
+#include "internal.h"
+#include "rawdec.h"
+#include "libavutil/intreadwrite.h"
+
+static int qoa_probe(const AVProbeData *p)
+{
+ if ((p->buf_size < 16) ||
+ (AV_RB32(p->buf) != MKBETAG('q','o','a','f')) ||
+ (AV_RB32(p->buf + 4) == 0) ||
+ (p->buf[8] == 0) ||
+ (AV_RB24(p->buf + 9) == 0) ||
+ (AV_RB16(p->buf + 12) == 0) ||
+ (AV_RB16(p->buf + 14) == 0))
+ return 0;
+ return AVPROBE_SCORE_MAX;
+}
+
+static int qoa_read_header(AVFormatContext *s)
+{
+ AVIOContext *pb = s->pb;
+ AVStream *st;
+
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ avio_skip(pb, 4);
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_QOA;
+ ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
+ st->duration = avio_rb32(pb);
+ st->start_time = 0;
+
+ ffio_ensure_seekback(pb, 4);
+ st->codecpar->ch_layout.nb_channels = avio_r8(pb);
+ if (st->codecpar->ch_layout.nb_channels == 0)
+ return AVERROR_INVALIDDATA;
+
+ st->codecpar->sample_rate = avio_rb24(pb);
+ if (st->codecpar->sample_rate == 0)
+ return AVERROR_INVALIDDATA;
+
+ avio_seek(pb, -4, SEEK_CUR);
+
+ avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
+
+ return 0;
+}
+
+const AVInputFormat ff_qoa_demuxer = {
+ .name = "qoa",
+ .long_name = NULL_IF_CONFIG_SMALL("raw QOA"),
+ .read_probe = qoa_probe,
+ .read_header = qoa_read_header,
+ .read_packet = ff_raw_read_partial_packet,
+ .flags = AVFMT_GENERIC_INDEX,
+ .extensions = "qoa",
+ .raw_codec_id = AV_CODEC_ID_QOA,
+ .priv_data_size = sizeof(FFRawDemuxerContext),
+ .priv_class = &ff_raw_demuxer_class,
+};
--
2.42.0
[-- Attachment #3: 0001-avcodec-add-QOA-decoder-and-parser.patch --]
[-- Type: text/x-patch, Size: 13159 bytes --]
From a5789be297faa409c00eb62c30afd0965f4d70ea Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 23 Sep 2023 16:49:25 +0200
Subject: [PATCH 1/2] avcodec: add QOA decoder and parser
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavcodec/Makefile | 2 +
libavcodec/allcodecs.c | 1 +
libavcodec/codec_desc.c | 7 ++
libavcodec/codec_id.h | 1 +
libavcodec/parsers.c | 1 +
libavcodec/qoa_parser.c | 89 ++++++++++++++++++++
libavcodec/qoadec.c | 175 ++++++++++++++++++++++++++++++++++++++++
7 files changed, 276 insertions(+)
create mode 100644 libavcodec/qoa_parser.c
create mode 100644 libavcodec/qoadec.c
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a1eb83f92d..c70d27a5c8 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -623,6 +623,7 @@ OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o \
OBJS-$(CONFIG_QDM2_DECODER) += qdm2.o
OBJS-$(CONFIG_QDMC_DECODER) += qdmc.o
OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o
+OBJS-$(CONFIG_QOA_DECODER) += qoadec.o
OBJS-$(CONFIG_QOI_DECODER) += qoidec.o
OBJS-$(CONFIG_QOI_ENCODER) += qoienc.o
OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o
@@ -1205,6 +1206,7 @@ OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \
vorbis_data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
+OBJS-$(CONFIG_QOA_PARSER) += qoa_parser.o
OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o
OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o
OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 4ea6515c6c..86d0972742 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -523,6 +523,7 @@ extern const FFCodec ff_paf_audio_decoder;
extern const FFCodec ff_qcelp_decoder;
extern const FFCodec ff_qdm2_decoder;
extern const FFCodec ff_qdmc_decoder;
+extern const FFCodec ff_qoa_decoder;
extern const FFCodec ff_ra_144_encoder;
extern const FFCodec ff_ra_144_decoder;
extern const FFCodec ff_ra_288_decoder;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 3ddd2fd3ee..fe838b49cb 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3434,6 +3434,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("Sonarc (Speech Compression)"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
+ {
+ .id = AV_CODEC_ID_QOA,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "qoa",
+ .long_name = NULL_IF_CONFIG_SMALL("QOA (Quite OK Audio)"),
+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+ },
/* subtitle codecs */
{
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 73352f5461..c313536f7b 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -546,6 +546,7 @@ enum AVCodecID {
AV_CODEC_ID_AC4,
AV_CODEC_ID_OSQ,
AV_CODEC_ID_SONARC,
+ AV_CODEC_ID_QOA,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index 5128009cd4..2ed96120f1 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -65,6 +65,7 @@ extern const AVCodecParser ff_mpegvideo_parser;
extern const AVCodecParser ff_opus_parser;
extern const AVCodecParser ff_png_parser;
extern const AVCodecParser ff_pnm_parser;
+extern const AVCodecParser ff_qoa_parser;
extern const AVCodecParser ff_qoi_parser;
extern const AVCodecParser ff_rv34_parser;
extern const AVCodecParser ff_sbc_parser;
diff --git a/libavcodec/qoa_parser.c b/libavcodec/qoa_parser.c
new file mode 100644
index 0000000000..0e5537a326
--- /dev/null
+++ b/libavcodec/qoa_parser.c
@@ -0,0 +1,89 @@
+/*
+ * QOA parser
+ *
+ * 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 "parser.h"
+
+typedef struct QOAParseContext {
+ ParseContext pc;
+ int frame_size;
+ int remaining;
+ int duration;
+} QOAParseContext;
+
+static int qoa_parse(AVCodecParserContext *s, AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+ QOAParseContext *qoa = s->priv_data;
+ uint64_t state = qoa->pc.state64;
+ int next = END_NOT_FOUND, i = 0;
+
+ *poutbuf_size = 0;
+ *poutbuf = NULL;
+
+ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+ next = buf_size;
+ } else {
+ if (!qoa->frame_size) {
+ for (; i < buf_size; i++) {
+ state = (state << 8) | buf[i];
+ if (((state & 0xFFFF) > 0 && (state >> 56))) {
+ qoa->frame_size = state & 0xFFFF;
+ qoa->duration = (state >> 16) & 0xFFFF;
+ break;
+ }
+ }
+ }
+
+ if (qoa->frame_size) {
+ if (!qoa->remaining)
+ qoa->remaining = qoa->frame_size;
+ if (qoa->remaining <= buf_size) {
+ next = qoa->remaining;
+ qoa->remaining = 0;
+ qoa->frame_size = 0;
+ state = 0;
+ } else {
+ qoa->remaining -= buf_size;
+ }
+ }
+
+ qoa->pc.state64 = state;
+ if (ff_combine_frame(&qoa->pc, next, &buf, &buf_size) < 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
+
+ s->duration = qoa->duration;
+ }
+
+ *poutbuf = buf;
+ *poutbuf_size = buf_size;
+
+ return next;
+}
+
+const AVCodecParser ff_qoa_parser = {
+ .codec_ids = { AV_CODEC_ID_QOA },
+ .priv_data_size = sizeof(QOAParseContext),
+ .parser_parse = qoa_parse,
+ .parser_close = ff_parse_close,
+};
diff --git a/libavcodec/qoadec.c b/libavcodec/qoadec.c
new file mode 100644
index 0000000000..9b2abae833
--- /dev/null
+++ b/libavcodec/qoadec.c
@@ -0,0 +1,175 @@
+/*
+ * QOA decoder
+ *
+ * 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 "avcodec.h"
+#include "codec_internal.h"
+#include "decode.h"
+#include "get_bits.h"
+#include "bytestream.h"
+#include "mathops.h"
+
+#define QOA_SLICE_LEN 20
+#define QOA_LMS_LEN 4
+
+typedef struct QOAChannel {
+ int history[QOA_LMS_LEN];
+ int weights[QOA_LMS_LEN];
+} QOAChannel;
+
+typedef struct QOAContext {
+ QOAChannel *ch;
+} QOAContext;
+
+static const int16_t qoa_dequant_tab[16][8] = {
+ { 1, -1, 3, -3, 5, -5, 7, -7},
+ { 5, -5, 18, -18, 32, -32, 49, -49},
+ { 16, -16, 53, -53, 95, -95, 147, -147},
+ { 34, -34, 113, -113, 203, -203, 315, -315},
+ { 63, -63, 210, -210, 378, -378, 588, -588},
+ { 104, -104, 345, -345, 621, -621, 966, -966},
+ { 158, -158, 528, -528, 950, -950, 1477, -1477},
+ { 228, -228, 760, -760, 1368, -1368, 2128, -2128},
+ { 316, -316, 1053, -1053, 1895, -1895, 2947, -2947},
+ { 422, -422, 1405, -1405, 2529, -2529, 3934, -3934},
+ { 548, -548, 1828, -1828, 3290, -3290, 5117, -5117},
+ { 696, -696, 2320, -2320, 4176, -4176, 6496, -6496},
+ { 868, -868, 2893, -2893, 5207, -5207, 8099, -8099},
+ {1064, -1064, 3548, -3548, 6386, -6386, 9933, -9933},
+ {1286, -1286, 4288, -4288, 7718, -7718, 12005, -12005},
+ {1536, -1536, 5120, -5120, 9216, -9216, 14336, -14336},
+};
+
+static av_cold int qoa_decode_init(AVCodecContext *avctx)
+{
+ QOAContext *s = avctx->priv_data;
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ s->ch = av_calloc(avctx->ch_layout.nb_channels, sizeof(*s->ch));
+ if (!s->ch)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static int qoa_lms_predict(QOAChannel *lms)
+{
+ int prediction = 0;
+ for (int i = 0; i < QOA_LMS_LEN; i++)
+ prediction += lms->weights[i] * lms->history[i];
+ return prediction >> 13;
+}
+
+static void qoa_lms_update(QOAChannel *lms, int sample, int residual)
+{
+ int delta = residual >> 4;
+ for (int i = 0; i < QOA_LMS_LEN; i++)
+ lms->weights[i] += lms->history[i] < 0 ? -delta : delta;
+ for (int i = 0; i < QOA_LMS_LEN-1; i++)
+ lms->history[i] = lms->history[i+1];
+ lms->history[QOA_LMS_LEN-1] = sample;
+}
+
+static int qoa_decode_frame(AVCodecContext *avctx, AVFrame *frame,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ QOAContext *s = avctx->priv_data;
+ int ret, frame_size, nb_channels;
+ GetByteContext gb;
+ int16_t *samples;
+
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
+ nb_channels = bytestream2_get_byte(&gb);
+ if (avctx->ch_layout.nb_channels != nb_channels)
+ return AVERROR_INVALIDDATA;
+
+ avctx->sample_rate = bytestream2_get_be24(&gb);
+ frame->nb_samples = bytestream2_get_be16(&gb);
+ frame_size = bytestream2_get_be16(&gb);
+ if (frame_size > avpkt->size)
+ return AVERROR_INVALIDDATA;
+
+ if (frame_size < 8 + QOA_LMS_LEN * 4 * nb_channels +
+ 8LL * frame->nb_samples * nb_channels / QOA_SLICE_LEN)
+ return AVERROR_INVALIDDATA;
+
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+ samples = (int16_t *)frame->data[0];
+
+ for (int ch = 0; ch < nb_channels; ch++) {
+ QOAChannel *qch = &s->ch[ch];
+
+ for (int n = 0; n < QOA_LMS_LEN; n++)
+ qch->history[n] = sign_extend(bytestream2_get_be16u(&gb), 16);
+ for (int n = 0; n < QOA_LMS_LEN; n++)
+ qch->weights[n] = sign_extend(bytestream2_get_be16u(&gb), 16);
+ }
+
+ for (int sample_index = 0; sample_index < frame->nb_samples * nb_channels;
+ sample_index += QOA_SLICE_LEN) {
+ for (int ch = 0; ch < nb_channels; ch++) {
+ QOAChannel *lms = &s->ch[ch];
+ uint64_t slice = bytestream2_get_be64u(&gb);
+ int scalefactor = (slice >> 60) & 0xf;
+ int slice_start = sample_index * nb_channels + ch;
+ int slice_end = av_clip(sample_index + QOA_SLICE_LEN, 0, frame->nb_samples) * nb_channels + ch;
+
+ for (int si = slice_start; si < slice_end; si += nb_channels) {
+ int predicted = qoa_lms_predict(lms);
+ int quantized = (slice >> 57) & 0x7;
+ int dequantized = qoa_dequant_tab[scalefactor][quantized];
+ int reconstructed = av_clip_int16(predicted + dequantized);
+
+ samples[si] = reconstructed;
+ slice <<= 3;
+
+ qoa_lms_update(lms, reconstructed, dequantized);
+ }
+ }
+ }
+
+ *got_frame_ptr = 1;
+
+ return avpkt->size;
+}
+
+static av_cold int qoa_decode_end(AVCodecContext *avctx)
+{
+ QOAContext *s = avctx->priv_data;
+ av_freep(&s->ch);
+ return 0;
+}
+
+const FFCodec ff_qoa_decoder = {
+ .p.name = "qoa",
+ CODEC_LONG_NAME("QOA (Quite OK Audio)"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_QOA,
+ .priv_data_size = sizeof(QOAContext),
+ .init = qoa_decode_init,
+ FF_CODEC_DECODE_CB(qoa_decode_frame),
+ .close = qoa_decode_end,
+ .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
+ AV_CODEC_CAP_DR1,
+ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
+ AV_SAMPLE_FMT_NONE },
+};
--
2.42.0
[-- Attachment #4: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-24 0:50 ` Paul B Mahol
@ 2023-09-27 12:44 ` Paul B Mahol
2023-09-27 12:54 ` Tomas Härdin
1 sibling, 0 replies; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 12:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sun, Sep 24, 2023 at 2:50 AM Paul B Mahol <onemda@gmail.com> wrote:
>
> New patches.
>
Will apply.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-24 0:50 ` Paul B Mahol
2023-09-27 12:44 ` Paul B Mahol
@ 2023-09-27 12:54 ` Tomas Härdin
2023-09-27 12:56 ` Paul B Mahol
1 sibling, 1 reply; 21+ messages in thread
From: Tomas Härdin @ 2023-09-27 12:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Needs a FATE test.
/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:54 ` Tomas Härdin
@ 2023-09-27 12:56 ` Paul B Mahol
2023-09-27 12:57 ` Tomas Härdin
0 siblings, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 12:56 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 2:55 PM Tomas Härdin <git@haerdin.se> wrote:
> Needs a FATE test.
>
>
Feel free to upload sample(s).
> /Tomas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:56 ` Paul B Mahol
@ 2023-09-27 12:57 ` Tomas Härdin
2023-09-27 12:59 ` Paul B Mahol
0 siblings, 1 reply; 21+ messages in thread
From: Tomas Härdin @ 2023-09-27 12:57 UTC (permalink / raw)
To: FFmpeg development discussions and patches
ons 2023-09-27 klockan 14:56 +0200 skrev Paul B Mahol:
> On Wed, Sep 27, 2023 at 2:55 PM Tomas Härdin <git@haerdin.se> wrote:
>
> > Needs a FATE test.
> >
> >
> Feel free to upload sample(s).
Don't have any. But I presume you do. Also wasn't it decided that new
formats/codecs mustn't be added without tests?
/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:57 ` Tomas Härdin
@ 2023-09-27 12:59 ` Paul B Mahol
2023-09-27 13:05 ` Tomas Härdin
0 siblings, 1 reply; 21+ messages in thread
From: Paul B Mahol @ 2023-09-27 12:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Sep 27, 2023 at 2:57 PM Tomas Härdin <git@haerdin.se> wrote:
> ons 2023-09-27 klockan 14:56 +0200 skrev Paul B Mahol:
> > On Wed, Sep 27, 2023 at 2:55 PM Tomas Härdin <git@haerdin.se> wrote:
> >
> > > Needs a FATE test.
> > >
> > >
> > Feel free to upload sample(s).
>
> Don't have any. But I presume you do. Also wasn't it decided that new
formats/codecs mustn't be added without tests?
>
Nope, that is ridiculous. One adds samples after.
> /Tomas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [FFmpeg-devel] [PATCH] QOA decoding support
2023-09-27 12:59 ` Paul B Mahol
@ 2023-09-27 13:05 ` Tomas Härdin
0 siblings, 0 replies; 21+ messages in thread
From: Tomas Härdin @ 2023-09-27 13:05 UTC (permalink / raw)
To: FFmpeg development discussions and patches
ons 2023-09-27 klockan 14:59 +0200 skrev Paul B Mahol:
> On Wed, Sep 27, 2023 at 2:57 PM Tomas Härdin <git@haerdin.se> wrote:
>
> > ons 2023-09-27 klockan 14:56 +0200 skrev Paul B Mahol:
> > > On Wed, Sep 27, 2023 at 2:55 PM Tomas Härdin <git@haerdin.se>
> > > wrote:
> > >
> > > > Needs a FATE test.
> > > >
> > > >
> > > Feel free to upload sample(s).
> >
> > Don't have any. But I presume you do. Also wasn't it decided that
> > new
>
> formats/codecs mustn't be added without tests?
> >
>
> Nope, that is ridiculous. One adds samples after.
As long as they get added. But there's a higher risk of forgetting if
one does it after the fact. Adding samples to fate-suite first and
demanding tests at the same time as the code is added means less risk
of forgetting.
/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2023-10-06 11:54 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-23 21:39 [FFmpeg-devel] [PATCH] QOA decoding support Paul B Mahol
2023-09-24 0:05 ` Andreas Rheinhardt
2023-09-24 0:48 ` Paul B Mahol
2023-09-27 12:52 ` Andreas Rheinhardt
2023-09-27 12:52 ` Paul B Mahol
2023-09-27 12:57 ` Nicolas George
2023-09-27 13:00 ` Paul B Mahol
2023-09-27 18:37 ` Michael Niedermayer
2023-09-27 19:59 ` Paul B Mahol
2023-10-06 11:54 ` Paul B Mahol
2023-09-27 13:02 ` Paul B Mahol
2023-09-27 12:58 ` Nicolas George
2023-09-27 13:05 ` Andreas Rheinhardt
2023-09-27 13:09 ` Paul B Mahol
2023-09-24 0:50 ` Paul B Mahol
2023-09-27 12:44 ` Paul B Mahol
2023-09-27 12:54 ` Tomas Härdin
2023-09-27 12:56 ` Paul B Mahol
2023-09-27 12:57 ` Tomas Härdin
2023-09-27 12:59 ` Paul B Mahol
2023-09-27 13:05 ` Tomas Härdin
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git