* [FFmpeg-devel] [PATCH] Bonk, Bonk
@ 2022-09-07 18:02 Paul B Mahol
2022-09-11 17:41 ` Paul B Mahol
2022-09-12 13:25 ` Martijn van Beurden
0 siblings, 2 replies; 4+ messages in thread
From: Paul B Mahol @ 2022-09-07 18:02 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 49 bytes --]
Patches attached.
Could decoder be made faster?
[-- Attachment #2: 0002-avformat-add-bonk-demuxer.patch --]
[-- Type: text/x-patch, Size: 4699 bytes --]
From 65a3956af251d296d88181db26fdfc8510be7031 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Wed, 7 Sep 2022 14:01:42 +0200
Subject: [PATCH 2/2] avformat: add bonk demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
libavformat/bonk.c | 83 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 libavformat/bonk.c
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 684bad0eb4..5cdcda3239 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -147,6 +147,7 @@ OBJS-$(CONFIG_BIT_MUXER) += bit.o
OBJS-$(CONFIG_BITPACKED_DEMUXER) += rawvideodec.o
OBJS-$(CONFIG_BMV_DEMUXER) += bmv.o
OBJS-$(CONFIG_BOA_DEMUXER) += boadec.o
+OBJS-$(CONFIG_BONK_DEMUXER) += bonk.o rawdec.o
OBJS-$(CONFIG_BFSTM_DEMUXER) += brstm.o
OBJS-$(CONFIG_BRSTM_DEMUXER) += brstm.o
OBJS-$(CONFIG_C93_DEMUXER) += c93.o voc_packet.o voc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index ae4479fb7a..cebd5e0c67 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -102,6 +102,7 @@ extern const AVInputFormat ff_bmv_demuxer;
extern const AVInputFormat ff_bfstm_demuxer;
extern const AVInputFormat ff_brstm_demuxer;
extern const AVInputFormat ff_boa_demuxer;
+extern const AVInputFormat ff_bonk_demuxer;
extern const AVInputFormat ff_c93_demuxer;
extern const AVInputFormat ff_caf_demuxer;
extern const AVOutputFormat ff_caf_muxer;
diff --git a/libavformat/bonk.c b/libavformat/bonk.c
new file mode 100644
index 0000000000..9dde30d483
--- /dev/null
+++ b/libavformat/bonk.c
@@ -0,0 +1,83 @@
+/*
+ * Bonk demuxer
+ * Copyright (c) 2016 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 "demux.h"
+#include "internal.h"
+#include "rawdec.h"
+
+static int bonk_probe(const AVProbeData *p)
+{
+ for (int i = 0; i < p->buf_size - 5; i++) {
+ if (!p->buf[i] && AV_RL32(p->buf + i + 1) == MKTAG('B','O','N','K') &&
+ !p->buf[i + 5])
+ return AVPROBE_SCORE_MAX;
+ else if (!p->buf[i])
+ break;
+ }
+
+ return 0;
+}
+
+static int bonk_read_header(AVFormatContext *s)
+{
+ AVStream *st;
+ int ret;
+
+ for (int i = 0; !avio_feof(s->pb); i++) {
+ int b = avio_r8(s->pb);
+ if (!b && avio_rl32(s->pb) == MKTAG('B','O','N','K'))
+ break;
+ else if (!b)
+ return AVERROR_INVALIDDATA;
+ }
+
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+ if ((ret = ff_get_extradata(s, st->codecpar, s->pb, 17)) < 0)
+ return ret;
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_BONK;
+ st->codecpar->sample_rate = AV_RL32(st->codecpar->extradata + 5);
+ st->codecpar->ch_layout.nb_channels = st->codecpar->extradata[9];
+ if (st->codecpar->ch_layout.nb_channels == 0)
+ return AVERROR_INVALIDDATA;
+ st->duration = AV_RL32(st->codecpar->extradata + 1) / st->codecpar->ch_layout.nb_channels;
+ avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
+ ffformatcontext(s)->data_offset = avio_tell(s->pb);
+
+ return 0;
+}
+
+const AVInputFormat ff_bonk_demuxer = {
+ .name = "bonk",
+ .long_name = NULL_IF_CONFIG_SMALL("raw Bonk"),
+ .read_probe = bonk_probe,
+ .read_header = bonk_read_header,
+ .read_packet = ff_raw_read_partial_packet,
+ .extensions = "bonk",
+ .flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
+ .raw_codec_id = AV_CODEC_ID_BONK,
+ .priv_data_size = sizeof(FFRawDemuxerContext),
+ .priv_class = &ff_raw_demuxer_class,
+};
--
2.37.2
[-- Attachment #3: 0001-avcodec-add-bonk-audio-decoder.patch --]
[-- Type: text/x-patch, Size: 15273 bytes --]
From a6e452321c7637dd9fa30b59a7753fe30ef701df Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Wed, 7 Sep 2022 13:58:53 +0200
Subject: [PATCH 1/2] avcodec: add bonk audio decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
libavcodec/Makefile | 1 +
libavcodec/allcodecs.c | 1 +
libavcodec/bonk.c | 424 ++++++++++++++++++++++++++++++++++++++++
libavcodec/codec_desc.c | 7 +
libavcodec/codec_id.h | 1 +
5 files changed, 434 insertions(+)
create mode 100644 libavcodec/bonk.c
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 945908e3b8..0b46bc0173 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -263,6 +263,7 @@ OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
OBJS-$(CONFIG_BMV_AUDIO_DECODER) += bmvaudio.o
OBJS-$(CONFIG_BMV_VIDEO_DECODER) += bmvvideo.o
+OBJS-$(CONFIG_BONK_DECODER) += bonk.o
OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
OBJS-$(CONFIG_C93_DECODER) += c93.o
OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 6939a4e25f..5d58a5d9f0 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -446,6 +446,7 @@ extern const FFCodec ff_atrac9_decoder;
extern const FFCodec ff_binkaudio_dct_decoder;
extern const FFCodec ff_binkaudio_rdft_decoder;
extern const FFCodec ff_bmv_audio_decoder;
+extern const FFCodec ff_bonk_decoder;
extern const FFCodec ff_cook_decoder;
extern const FFCodec ff_dca_encoder;
extern const FFCodec ff_dca_decoder;
diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
new file mode 100644
index 0000000000..f696122ada
--- /dev/null
+++ b/libavcodec/bonk.c
@@ -0,0 +1,424 @@
+/*
+ * Bonk audio 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 "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
+#include "avcodec.h"
+#include "codec_internal.h"
+#include "decode.h"
+#define BITSTREAM_READER_LE
+#include "get_bits.h"
+#include "bytestream.h"
+
+typedef struct BitCount {
+ uint8_t bit;
+ unsigned count;
+} BitCount;
+
+typedef struct BonkContext {
+ GetBitContext gb;
+ int skip;
+
+ uint8_t *bitstream;
+ int max_framesize;
+ int bitstream_size;
+ int bitstream_index;
+
+ uint64_t nb_samples;
+ int lossless;
+ int mid_side;
+ int n_taps;
+ int down_sampling;
+ int samples_per_packet;
+
+ int state[2][2048], k[2048];
+ int *samples;
+ int *input_samples;
+ uint8_t quant[2048];
+ BitCount *bits;
+} BonkContext;
+
+static av_cold int bonk_close(AVCodecContext *avctx)
+{
+ BonkContext *s = avctx->priv_data;
+
+ av_freep(&s->bitstream);
+ av_freep(&s->input_samples);
+ av_freep(&s->samples);
+ av_freep(&s->bits);
+ s->bitstream_size = 0;
+
+ return 0;
+}
+
+static av_cold int bonk_init(AVCodecContext *avctx)
+{
+ BonkContext *s = avctx->priv_data;
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ if (avctx->extradata_size < 17)
+ return AVERROR(EINVAL);
+
+ if (avctx->extradata[0]) {
+ av_log(avctx, AV_LOG_ERROR, "Unsupported version.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avctx->ch_layout.nb_channels < 1 || avctx->ch_layout.nb_channels > 2)
+ return AVERROR_INVALIDDATA;
+
+ s->nb_samples = AV_RL32(avctx->extradata + 1) / avctx->ch_layout.nb_channels;
+ if (!s->nb_samples)
+ s->nb_samples = UINT64_MAX;
+ s->lossless = avctx->extradata[10] != 0;
+ s->mid_side = avctx->extradata[11] != 0;
+ s->n_taps = AV_RL16(avctx->extradata + 12);
+ if (!s->n_taps || s->n_taps > 2048)
+ return AVERROR(EINVAL);
+
+ s->down_sampling = avctx->extradata[14];
+ if (!s->down_sampling)
+ return AVERROR(EINVAL);
+
+ s->samples_per_packet = AV_RL16(avctx->extradata + 15);
+ if (!s->samples_per_packet)
+ return AVERROR(EINVAL);
+ s->max_framesize = s->samples_per_packet * avctx->ch_layout.nb_channels * s->down_sampling * 32;
+ s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream));
+ if (!s->bitstream)
+ return AVERROR(ENOMEM);
+
+ s->input_samples = av_calloc(s->samples_per_packet, sizeof(*s->input_samples));
+ if (!s->input_samples)
+ return AVERROR(ENOMEM);
+
+ s->samples = av_calloc(s->samples_per_packet * s->down_sampling * avctx->ch_layout.nb_channels, sizeof(*s->samples));
+ if (!s->samples)
+ return AVERROR(ENOMEM);
+
+ s->bits = av_calloc(s->max_framesize * 8, sizeof(*s->bits));
+ if (!s->bits)
+ return AVERROR(ENOMEM);
+
+ for (int i = 0; i < 512; i++) {
+ s->quant[i] = sqrt(i + 1);
+ }
+
+ return 0;
+}
+
+static unsigned read_uint_max(BonkContext *s, uint32_t max)
+{
+ unsigned value = 0;
+ int i, bits;
+
+ if (max == 0)
+ return 0;
+
+ if (max >> 31)
+ return 32;
+
+ bits = 32 - ff_clz(max);
+
+ for (i = 0; i < bits - 1; i++)
+ if (get_bits1(&s->gb))
+ value += 1 << i;
+
+ if ((value | (1 << (bits - 1))) <= max)
+ if (get_bits1(&s->gb))
+ value += 1 << (bits - 1);
+
+ return value;
+}
+
+static int intlist_read(BonkContext *s, int *buf, int entries, int base_2_part)
+{
+ int i, low_bits = 0, x = 0, max_x;
+ int n_zeros = 0, step = 256, dominant = 0;
+ int pos = 0, level = 0;
+ BitCount *bits = s->bits;
+
+ memset(buf, 0, entries * sizeof(*buf));
+ if (base_2_part) {
+ low_bits = get_bits(&s->gb, 4);
+
+ if (low_bits)
+ for (i = 0; i < entries; i++)
+ buf[i] = get_bits(&s->gb, low_bits);
+ }
+
+ while (n_zeros < entries) {
+ int steplet = step >> 8;
+
+ if (get_bits_left(&s->gb) <= 0)
+ return AVERROR_INVALIDDATA;
+
+ if (!get_bits1(&s->gb)) {
+ if (steplet < 0)
+ break;
+
+ if (steplet > 0) {
+ bits[x ].bit = dominant;
+ bits[x++].count = steplet;
+ }
+
+ if (!dominant)
+ n_zeros += steplet;
+
+ step += step / 8;
+ } else if (steplet > 0) {
+ int actual_run = read_uint_max(s, steplet - 1);
+
+ if (actual_run < 0)
+ break;
+
+ if (actual_run > 0) {
+ bits[x ].bit = dominant;
+ bits[x++].count = actual_run;
+ }
+
+ bits[x ].bit = !dominant;
+ bits[x++].count = 1;
+
+ if (!dominant)
+ n_zeros += actual_run;
+ else
+ n_zeros++;
+
+ step -= step / 8;
+ }
+
+ if (step < 256) {
+ if (step == 0)
+ return AVERROR_INVALIDDATA;
+ step = 65536 / step;
+ dominant = !dominant;
+ }
+ }
+
+ max_x = x;
+ x = 0;
+ n_zeros = 0;
+ for (i = 0; n_zeros < entries; i++) {
+ while (1) {
+ if (pos >= entries) {
+ pos = 0;
+ level += 1 << low_bits;
+ }
+
+ if (buf[pos] >= level)
+ break;
+
+ pos++;
+ }
+
+ if (x >= max_x)
+ return AVERROR_INVALIDDATA;
+ if (bits[x].bit)
+ buf[pos] += 1 << low_bits;
+ else
+ n_zeros++;
+
+ bits[x].count--;
+ if (bits[x].count == 0)
+ x++;
+
+ pos++;
+ }
+
+ for (i = 0; i < entries; i++) {
+ if (buf[i] && get_bits1(&s->gb)) {
+ buf[i] = -buf[i];
+ }
+ }
+
+ return 0;
+}
+
+static inline int shift_down(int a, int b)
+{
+ return (a >> b) + (a < 0);
+}
+
+static inline int shift(int a, int b)
+{
+ return a + (1 << b - 1) >> b;
+}
+
+#define LATTICE_SHIFT 10
+#define SAMPLE_SHIFT 4
+#define SAMPLE_FACTOR (1 << SAMPLE_SHIFT)
+
+static int predictor_calc_error(int *k, int *state, int order, int error)
+{
+ int i, x = error - shift_down(k[order-1] * state[order-1], LATTICE_SHIFT);
+ int *k_ptr = &(k[order-2]),
+ *state_ptr = &(state[order-2]);
+
+ for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--) {
+ int k_value = *k_ptr, state_value = *state_ptr;
+
+ x -= shift_down(k_value * state_value, LATTICE_SHIFT);
+ state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT);
+ }
+
+ // don't drift too far, to avoid overflows
+ av_clip(x, -(SAMPLE_FACTOR << 16), SAMPLE_FACTOR << 16);
+
+ state[0] = x;
+
+ return x;
+}
+
+static void predictor_init_state(int *k, int *state, int order)
+{
+ for (int i = order - 2; i >= 0; i--) {
+ int x = state[i];
+
+ for (int j = 0, p = i + 1; p < order; j++, p++) {
+ int tmp = x + shift_down(k[j] * state[p], LATTICE_SHIFT);
+
+ state[p] += shift_down(k[j] * x, LATTICE_SHIFT);
+ x = tmp;
+ }
+ }
+}
+
+static int bonk_decode(AVCodecContext *avctx, AVFrame *frame,
+ int *got_frame_ptr, AVPacket *pkt)
+{
+ BonkContext *s = avctx->priv_data;
+ GetBitContext *gb = &s->gb;
+ const uint8_t *buf;
+ int16_t *samples;
+ int quant, n, buf_size, input_buf_size;
+ int ret = AVERROR_INVALIDDATA;
+
+ if ((!pkt->size && !s->bitstream_size) || s->nb_samples == 0) {
+ *got_frame_ptr = 0;
+ return pkt->size;
+ }
+
+ buf_size = FFMIN(pkt->size, s->max_framesize - s->bitstream_size);
+ input_buf_size = buf_size;
+ if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE > s->max_framesize) {
+ memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
+ s->bitstream_index = 0;
+ }
+ if (pkt->data)
+ memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], pkt->data, buf_size);
+ buf = &s->bitstream[s->bitstream_index];
+ buf_size += s->bitstream_size;
+ s->bitstream_size = buf_size;
+ if (buf_size < s->max_framesize && pkt->data) {
+ *got_frame_ptr = 0;
+ return input_buf_size;
+ }
+
+ frame->nb_samples = FFMIN(s->samples_per_packet * s->down_sampling, s->nb_samples);
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+ samples = (int16_t *)frame->data[0];
+
+ if ((ret = init_get_bits8(gb, buf, buf_size)) < 0)
+ return ret;
+
+ skip_bits(gb, s->skip);
+ if ((ret = intlist_read(s, s->k, s->n_taps, 0)) < 0)
+ return ret;
+
+ for (int i = 0; i < s->n_taps; i++)
+ s->k[i] *= s->quant[i];
+ quant = s->lossless ? 1 : get_bits(&s->gb, 16) * SAMPLE_FACTOR;
+
+ for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {
+ int *sample = s->samples + ch;
+
+ predictor_init_state(s->k, s->state[ch], s->n_taps);
+ if ((ret = intlist_read(s, s->input_samples, s->samples_per_packet, 1)) < 0)
+ return ret;
+
+ for (int i = 0; i < s->samples_per_packet; i++) {
+ for (int j = 0; j < s->down_sampling - 1; j++) {
+ *sample = predictor_calc_error(s->k, s->state[ch], s->n_taps, 0);
+ sample += avctx->ch_layout.nb_channels;
+ }
+
+ *sample = predictor_calc_error(s->k, s->state[ch], s->n_taps, s->input_samples[i] * quant);
+ sample += avctx->ch_layout.nb_channels;
+ }
+
+ for (int i = 0; i < s->n_taps; i++)
+ s->state[ch][i] = s->samples[s->samples_per_packet * s->down_sampling * avctx->ch_layout.nb_channels -
+ avctx->ch_layout.nb_channels + ch - i * avctx->ch_layout.nb_channels];
+ }
+
+ if (s->mid_side && avctx->ch_layout.nb_channels == 2) {
+ for (int i = 0; i < frame->nb_samples * 2; i += 2) {
+ s->samples[i + 1] += shift(s->samples[i], 1);
+ s->samples[i] -= s->samples[i + 1];
+ }
+ }
+
+ if (!s->lossless) {
+ for (int i = 0; i < frame->nb_samples * avctx->ch_layout.nb_channels; i++)
+ s->samples[i] = shift(s->samples[i], 4);
+ }
+
+ for (int i = 0; i < frame->nb_samples * avctx->ch_layout.nb_channels; i++) {
+ samples[i] = av_clip_int16(s->samples[i]);
+ }
+
+ s->nb_samples -= frame->nb_samples;
+
+ s->skip = get_bits_count(gb) - 8 * (get_bits_count(gb) / 8);
+ n = get_bits_count(gb) / 8;
+
+ if (n > buf_size) {
+ s->bitstream_size = 0;
+ s->bitstream_index = 0;
+ return AVERROR_INVALIDDATA;
+ }
+
+ *got_frame_ptr = 1;
+
+ if (s->bitstream_size) {
+ s->bitstream_index += n;
+ s->bitstream_size -= n;
+ return input_buf_size;
+ }
+ return n;
+}
+
+const FFCodec ff_bonk_decoder = {
+ .p.name = "bonk",
+ CODEC_LONG_NAME("Bonk audio"),
+ .p.type = AVMEDIA_TYPE_AUDIO,
+ .p.id = AV_CODEC_ID_BONK,
+ .priv_data_size = sizeof(BonkContext),
+ .init = bonk_init,
+ FF_CODEC_DECODE_CB(bonk_decode),
+ .close = bonk_close,
+ .p.capabilities = AV_CODEC_CAP_DELAY |
+ AV_CODEC_CAP_DR1 |
+ AV_CODEC_CAP_SUBFRAMES,
+ .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
+ AV_SAMPLE_FMT_NONE },
+};
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 06dfe55d0f..c002480d39 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -3290,6 +3290,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("DFPWM (Dynamic Filter Pulse Width Modulation)"),
.props = AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_BONK,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "bonk",
+ .long_name = NULL_IF_CONFIG_SMALL("Bonk audio"),
+ .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+ },
/* subtitle codecs */
{
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 2247bc0309..858b5c3a75 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -527,6 +527,7 @@ enum AVCodecID {
AV_CODEC_ID_FASTAUDIO,
AV_CODEC_ID_MSNSIREN,
AV_CODEC_ID_DFPWM,
+ AV_CODEC_ID_BONK,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
--
2.37.2
[-- 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] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Bonk, Bonk
2022-09-07 18:02 [FFmpeg-devel] [PATCH] Bonk, Bonk Paul B Mahol
@ 2022-09-11 17:41 ` Paul B Mahol
2022-09-12 13:25 ` Martijn van Beurden
1 sibling, 0 replies; 4+ messages in thread
From: Paul B Mahol @ 2022-09-11 17:41 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 9/7/22, Paul B Mahol <onemda@gmail.com> wrote:
> Patches attached.
>
> Could decoder be made faster?
>
Will apply 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] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Bonk, Bonk
2022-09-07 18:02 [FFmpeg-devel] [PATCH] Bonk, Bonk Paul B Mahol
2022-09-11 17:41 ` Paul B Mahol
@ 2022-09-12 13:25 ` Martijn van Beurden
2022-09-14 12:54 ` Paul B Mahol
1 sibling, 1 reply; 4+ messages in thread
From: Martijn van Beurden @ 2022-09-12 13:25 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Op wo 7 sep. 2022 om 19:59 schreef Paul B Mahol <onemda@gmail.com>:
> Patches attached.
>
> Could decoder be made faster?
>
>
Haven't reviewed, but great to have another codec added. Concerning the
speed, as far as I know Bonk is slow to decode. Its website states that it
is slow: http://www.logarithmic.net/pfh/bonk Also, an old comparison that
included it (I haven't seen any more recent one) ranked it the slowest
decoding codec:
https://web.archive.org/web/20080225210007/http://flac.sourceforge.net/comparison.html
Although OptimFROG and the higher MP4ALS preset are probably much
slower/more CPU intensive to decode nowadays.
_______________________________________________
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] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Bonk, Bonk
2022-09-12 13:25 ` Martijn van Beurden
@ 2022-09-14 12:54 ` Paul B Mahol
0 siblings, 0 replies; 4+ messages in thread
From: Paul B Mahol @ 2022-09-14 12:54 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 9/12/22, Martijn van Beurden <mvanb1@gmail.com> wrote:
> Op wo 7 sep. 2022 om 19:59 schreef Paul B Mahol <onemda@gmail.com>:
>
>> Patches attached.
>>
>> Could decoder be made faster?
>>
>>
> Haven't reviewed, but great to have another codec added. Concerning the
> speed, as far as I know Bonk is slow to decode. Its website states that it
> is slow: http://www.logarithmic.net/pfh/bonk Also, an old comparison that
> included it (I haven't seen any more recent one) ranked it the slowest
> decoding codec:
> https://web.archive.org/web/20080225210007/http://flac.sourceforge.net/comparison.html
>
> Although OptimFROG and the higher MP4ALS preset are probably much
> slower/more CPU intensive to decode nowadays.
Yes, by looking at code I already located part that takes most of time.
The codec is slow because it operates on some kind of
channel bit planes.
> _______________________________________________
> 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] 4+ messages in thread
end of thread, other threads:[~2022-09-14 12:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 18:02 [FFmpeg-devel] [PATCH] Bonk, Bonk Paul B Mahol
2022-09-11 17:41 ` Paul B Mahol
2022-09-12 13:25 ` Martijn van Beurden
2022-09-14 12:54 ` Paul B Mahol
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