History

avcodec: add SGA PCM decoder

Paul B Mahol committed 5 years ago

Commit 51117071 parent 0e645b97 files · +21 −1Browse files

Unified · Split

7 files
  1. libavcodec/Makefile +1 −0
  2. libavcodec/allcodecs.c +1 −0
  3. libavcodec/codec_desc.c +7 −0
  4. libavcodec/codec_id.h +1 −0
  5. libavcodec/pcm.c +9 −0
  6. libavcodec/utils.c +1 −0
  7. libavcodec/version.h +1 −1
libavcodec/Makefile+1−0
@@ -830,6 +830,7 @@ OBJS-$(CONFIG_PCM_S64BE_DECODER) += pcm.o · 829 unmodified lines
830830 OBJS-$(CONFIG_PCM_S64BE_ENCODER) += pcm.o
831831 OBJS-$(CONFIG_PCM_S64LE_DECODER) += pcm.o
832832 OBJS-$(CONFIG_PCM_S64LE_ENCODER) += pcm.o
833+OBJS-$(CONFIG_PCM_SGA_DECODER) += pcm.o
833834 OBJS-$(CONFIG_PCM_U8_DECODER) += pcm.o
834835 OBJS-$(CONFIG_PCM_U8_ENCODER) += pcm.o
835836 OBJS-$(CONFIG_PCM_U16BE_DECODER) += pcm.o
libavcodec/allcodecs.c+1−0
@@ -568,6 +568,7 @@ extern AVCodec ff_pcm_s64be_encoder; · 567 unmodified lines
568568 extern AVCodec ff_pcm_s64be_decoder;
569569 extern AVCodec ff_pcm_s64le_encoder;
570570 extern AVCodec ff_pcm_s64le_decoder;
571+extern AVCodec ff_pcm_sga_decoder;
571572 extern AVCodec ff_pcm_u8_encoder;
572573 extern AVCodec ff_pcm_u8_decoder;
573574 extern AVCodec ff_pcm_u16be_encoder;
libavcodec/codec_desc.c+7−0
@@ -2096,6 +2096,13 @@ static const AVCodecDescriptor codec_descriptors[] = { · 2095 unmodified lines
20962096 .long_name = NULL_IF_CONFIG_SMALL("PCM Archimedes VIDC"),
20972097 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
20982098 },
2099+ {
2100+ .id = AV_CODEC_ID_PCM_SGA,
2101+ .type = AVMEDIA_TYPE_AUDIO,
2102+ .name = "pcm_sga",
2103+ .long_name = NULL_IF_CONFIG_SMALL("PCM SGA"),
2104+ .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
2105+ },
20992106
21002107 /* various ADPCM codecs */
21012108 {
libavcodec/codec_id.h+1−0
@@ -346,6 +346,7 @@ enum AVCodecID { · 345 unmodified lines
346346 AV_CODEC_ID_PCM_F16LE,
347347 AV_CODEC_ID_PCM_F24LE,
348348 AV_CODEC_ID_PCM_VIDC,
349+ AV_CODEC_ID_PCM_SGA,
349350
350351 /* various ADPCM codecs */
351352 AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
libavcodec/pcm.c+9−0
@@ -419,6 +419,14 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 418 unmodified lines
419419 for (; n > 0; n--)
420420 *samples++ = *src++ + 128;
421421 break;
422+ case AV_CODEC_ID_PCM_SGA:
423+ for (; n > 0; n--) {
424+ int sign = *src >> 7;
425+ int magn = *src & 0x7f;
426+ *samples++ = sign ? 128 - magn : 128 + magn;
427+ src++;
428+ }
429+ break;
422430 case AV_CODEC_ID_PCM_S8_PLANAR:
423431 n /= avctx->channels;
424432 for (c = 0; c < avctx->channels; c++) {
@@ -622,3 +630,4 @@ PCM_CODEC (PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned · 197 unmodified lines
622630 PCM_CODEC (PCM_S64BE, AV_SAMPLE_FMT_S64, pcm_s64be, "PCM signed 64-bit big-endian");
623631 PCM_CODEC (PCM_S64LE, AV_SAMPLE_FMT_S64, pcm_s64le, "PCM signed 64-bit little-endian");
624632 PCM_CODEC (PCM_VIDC, AV_SAMPLE_FMT_S16, pcm_vidc, "PCM Archimedes VIDC");
633+PCM_DECODER(PCM_SGA, AV_SAMPLE_FMT_U8, pcm_sga, "PCM SGA");
libavcodec/utils.c+1−0
@@ -1547,6 +1547,7 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id) · 1546 unmodified lines
15471547 case AV_CODEC_ID_PCM_VIDC:
15481548 case AV_CODEC_ID_PCM_S8:
15491549 case AV_CODEC_ID_PCM_S8_PLANAR:
1550+ case AV_CODEC_ID_PCM_SGA:
15501551 case AV_CODEC_ID_PCM_U8:
15511552 case AV_CODEC_ID_SDX2_DPCM:
15521553 case AV_CODEC_ID_DERF_DPCM:
libavcodec/version.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include "libavutil/version.h"
2929
3030 #define LIBAVCODEC_VERSION_MAJOR 58
31−#define LIBAVCODEC_VERSION_MINOR 126
31+#define LIBAVCODEC_VERSION_MINOR 127
3232 #define LIBAVCODEC_VERSION_MICRO 100
3333
3434 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t