diff options
author | William Wilgus <me.theuser@yahoo.com> | 2024-11-24 11:38:16 -0500 |
---|---|---|
committer | Gerrit Rockbox <gerrit@rockbox.org> | 2024-11-24 11:38:16 -0500 |
commit | 1fddea5e8e6ba23847b67eee8bf372de87697679 (patch) | |
tree | 82c01be00fef97934ca9d3cd3ffcc00a97ff7dd6 | |
parent | 4ec34f698603d6498b0ec6be42678968a36a82f1 (diff) | |
download | rockbox-1fddea5e8e.tar.gz rockbox-1fddea5e8e.zip |
Revert "[BugFix] Enums are only 2 bytes on some Devices"
This reverts commit 4ec34f698603d6498b0ec6be42678968a36a82f1.
Reason for revert:
-fshort-enums makes them smaller if the explicitrly enumerated values will fit in a smaller type
Change-Id: I834dfd2b2039eda91bc02c9cf95a0f9dfc5783f6
-rw-r--r-- | lib/rbcodec/codecs/aiff.c | 14 | ||||
-rw-r--r-- | lib/rbcodec/codecs/cRSID/C64/C64.c | 4 | ||||
-rw-r--r-- | lib/rbcodec/codecs/cRSID/libcRSID.c | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/codecs.h | 6 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/ay_emu.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/blip_buffer.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/gb_apu.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/gb_cpu.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/gb_oscs.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/kss_emu.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/nes_apu.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/nes_cpu.h | 4 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/nsf_emu.h | 4 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libgme/track_filter.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libspc/spc_codec.h | 4 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libwmavoice/avcodec.h | 265 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libwmavoice/internal.h | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libwmavoice/utils.c | 12 |
18 files changed, 165 insertions, 168 deletions
diff --git a/lib/rbcodec/codecs/aiff.c b/lib/rbcodec/codecs/aiff.c index 1c4af27949..a82ae5f2e2 100644 --- a/lib/rbcodec/codecs/aiff.c +++ b/lib/rbcodec/codecs/aiff.c @@ -29,12 +29,14 @@ CODEC_HEADER ((((uint32_t)c1)<<24)|(((uint32_t)c2)<<16)|(((uint32_t)c3)<<8)|((uint32_t)c4)) /* This codec supports the following AIFC compressionType formats */ -#define AIFC_FORMAT_PCM FOURCC('N', 'O', 'N', 'E') /* AIFC PCM Format (big endian) */ -#define AIFC_FORMAT_ALAW FOURCC('a', 'l', 'a', 'w') /* AIFC ALaw compressed */ -#define AIFC_FORMAT_MULAW FOURCC('u', 'l', 'a', 'w') /* AIFC uLaw compressed */ -#define AIFC_FORMAT_IEEE_FLOAT32 FOURCC('f', 'l', '3', '2') /* AIFC IEEE float 32 bit */ -#define AIFC_FORMAT_IEEE_FLOAT64 FOURCC('f', 'l', '6', '4') /* AIFC IEEE float 64 bit */ -#define AIFC_FORMAT_QT_IMA_ADPCM FOURCC('i', 'm', 'a', '4') /* AIFC QuickTime IMA ADPCM */ +enum { + AIFC_FORMAT_PCM = FOURCC('N', 'O', 'N', 'E'), /* AIFC PCM Format (big endian) */ + AIFC_FORMAT_ALAW = FOURCC('a', 'l', 'a', 'w'), /* AIFC ALaw compressed */ + AIFC_FORMAT_MULAW = FOURCC('u', 'l', 'a', 'w'), /* AIFC uLaw compressed */ + AIFC_FORMAT_IEEE_FLOAT32 = FOURCC('f', 'l', '3', '2'), /* AIFC IEEE float 32 bit */ + AIFC_FORMAT_IEEE_FLOAT64 = FOURCC('f', 'l', '6', '4'), /* AIFC IEEE float 64 bit */ + AIFC_FORMAT_QT_IMA_ADPCM = FOURCC('i', 'm', 'a', '4'), /* AIFC QuickTime IMA ADPCM */ +}; static const struct pcm_entry pcm_codecs[] = { { AIFC_FORMAT_PCM, get_linear_pcm_codec }, diff --git a/lib/rbcodec/codecs/cRSID/C64/C64.c b/lib/rbcodec/codecs/cRSID/C64/C64.c index 07e60f0e77..f8e7a9a116 100644 --- a/lib/rbcodec/codecs/cRSID/C64/C64.c +++ b/lib/rbcodec/codecs/cRSID/C64/C64.c @@ -31,9 +31,7 @@ cRSID_C64instance* cRSID_createC64 (cRSID_C64instance* C64, unsigned short sampl void cRSID_setC64 (cRSID_C64instance* C64) { //set hardware-parameters (Models, SIDs) for playback of loaded SID-tune -#define C64_PAL_CPUCLK (985248) -#define C64_NTSC_CPUCLK (1022727) - + enum C64clocks { C64_PAL_CPUCLK=985248, C64_NTSC_CPUCLK=1022727 }; enum C64scanlines { C64_PAL_SCANLINES = 312, C64_NTSC_SCANLINES = 263 }; enum C64scanlineCycles { C64_PAL_SCANLINE_CYCLES = 63, C64_NTSC_SCANLINE_CYCLES = 65 }; //enum C64framerates { PAL_FRAMERATE = 50, NTSC_FRAMERATE = 60 }; //Hz diff --git a/lib/rbcodec/codecs/cRSID/libcRSID.c b/lib/rbcodec/codecs/cRSID/libcRSID.c index 3117372c98..f7ef713e12 100644 --- a/lib/rbcodec/codecs/cRSID/libcRSID.c +++ b/lib/rbcodec/codecs/cRSID/libcRSID.c @@ -104,7 +104,7 @@ char cRSID_playSIDfile(cRSID_C64instance* C64, char* filename, char subtune) { cRSID_SIDheader* cRSID_loadSIDtune(cRSID_C64instance* C64, char* filename) { -#define CRSID_FILESIZE_MAX (100000) + enum SIDspecs { CRSID_FILESIZE_MAX = 100000 }; int FileSize; static unsigned char SIDfileData [CRSID_FILESIZE_MAX]; //use memset? diff --git a/lib/rbcodec/codecs/codecs.h b/lib/rbcodec/codecs/codecs.h index 3b359df872..18416afba8 100644 --- a/lib/rbcodec/codecs/codecs.h +++ b/lib/rbcodec/codecs/codecs.h @@ -102,12 +102,10 @@ enum codec_command_action { #ifdef HAVE_RECORDING CODEC_ACTION_STREAM_FINISH = 2, #endif - + CODEC_ACTION_MIN = LONG_MIN, + CODEC_ACTION_MAX = LONG_MAX, }; -#define CODEC_ACTION_MIN (LONG_MIN) -#define CODEC_ACTION_MAX = (LONG_MAX) - /* NOTE: To support backwards compatibility, only add new functions at the end of the structure. Every time you add a new function, remember to increase CODEC_API_VERSION. If you make changes to the diff --git a/lib/rbcodec/codecs/libgme/ay_emu.h b/lib/rbcodec/codecs/libgme/ay_emu.h index 9b42e25e12..7334167876 100644 --- a/lib/rbcodec/codecs/libgme/ay_emu.h +++ b/lib/rbcodec/codecs/libgme/ay_emu.h @@ -14,7 +14,7 @@ // 64K memory to load code and data into before starting track. Caller // must parse the AY file. -#define mem_size (0x10000) +enum { mem_size = 0x10000 }; enum { ram_addr = 0x4000 }; // where official RAM starts // AY file header diff --git a/lib/rbcodec/codecs/libgme/blip_buffer.h b/lib/rbcodec/codecs/libgme/blip_buffer.h index d2114abaf3..5fe1f4b9c6 100644 --- a/lib/rbcodec/codecs/libgme/blip_buffer.h +++ b/lib/rbcodec/codecs/libgme/blip_buffer.h @@ -34,7 +34,7 @@ static int const blip_buffer_extra_ = BLIP_MAX_QUALITY + 2; // Properties of fixed-point sample position typedef unsigned ufixed_t; // unsigned for more range, optimized shifts enum { fixed_bits = BLIP_BUFFER_ACCURACY }; // bits in fraction -#define fixed_unit (1 << fixed_bits) // 1.0 samples +enum { fixed_unit = 1 << fixed_bits }; // 1.0 samples // Deltas in buffer are fixed-point with this many fraction bits. // Less than 16 for extra range. diff --git a/lib/rbcodec/codecs/libgme/gb_apu.h b/lib/rbcodec/codecs/libgme/gb_apu.h index 168b4de26b..69307b9840 100644 --- a/lib/rbcodec/codecs/libgme/gb_apu.h +++ b/lib/rbcodec/codecs/libgme/gb_apu.h @@ -7,7 +7,7 @@ #include "gb_oscs.h" // Clock rate sound hardware runs at -#define clock_rate (4194304 * GB_APU_OVERCLOCK) +enum { clock_rate = 4194304 * GB_APU_OVERCLOCK }; // Registers are at io_addr to io_addr+io_size-1 enum { io_addr = 0xFF10 }; diff --git a/lib/rbcodec/codecs/libgme/gb_cpu.h b/lib/rbcodec/codecs/libgme/gb_cpu.h index 95c7250f92..37b22141d7 100644 --- a/lib/rbcodec/codecs/libgme/gb_cpu.h +++ b/lib/rbcodec/codecs/libgme/gb_cpu.h @@ -11,7 +11,7 @@ typedef int addr_t; // Emulator reads this many bytes past end of a page enum { cpu_padding = 8 }; -#define mem_size (0x10000) +enum { mem_size = 0x10000 }; enum { page_bits = 13 }; enum { page_size = 1 << page_bits }; enum { page_count = mem_size >> page_bits }; diff --git a/lib/rbcodec/codecs/libgme/gb_oscs.h b/lib/rbcodec/codecs/libgme/gb_oscs.h index a5d89c08fd..3c8dfef51f 100644 --- a/lib/rbcodec/codecs/libgme/gb_oscs.h +++ b/lib/rbcodec/codecs/libgme/gb_oscs.h @@ -98,7 +98,7 @@ static inline void Sweep_reset( struct Gb_Square* this ) // Noise -#define period2_mask (0x1FFFF) +enum { period2_mask = 0x1FFFF }; struct Gb_Noise { struct Gb_Osc osc; diff --git a/lib/rbcodec/codecs/libgme/kss_emu.h b/lib/rbcodec/codecs/libgme/kss_emu.h index 8f9aa8f2aa..382e4b807b 100644 --- a/lib/rbcodec/codecs/libgme/kss_emu.h +++ b/lib/rbcodec/codecs/libgme/kss_emu.h @@ -34,7 +34,7 @@ enum { enum { idle_addr = 0xFFFF }; enum { scc_enabled_true = 0xC000 }; -#define mem_size (0x10000) +enum { mem_size = 0x10000 }; // KSS file header enum { header_size = 0x20 }; diff --git a/lib/rbcodec/codecs/libgme/nes_apu.h b/lib/rbcodec/codecs/libgme/nes_apu.h index ceb4413e21..152ec94a17 100644 --- a/lib/rbcodec/codecs/libgme/nes_apu.h +++ b/lib/rbcodec/codecs/libgme/nes_apu.h @@ -9,7 +9,7 @@ enum { apu_status_addr = 0x4015 }; enum { apu_osc_count = 5 }; -#define apu_no_irq (INT_MAX/2 + 1) +enum { apu_no_irq = INT_MAX/2 + 1 }; enum { apu_irq_waiting = 0 }; enum { apu_io_addr = 0x4000 }; diff --git a/lib/rbcodec/codecs/libgme/nes_cpu.h b/lib/rbcodec/codecs/libgme/nes_cpu.h index 72f59d30e5..e4538cd00c 100644 --- a/lib/rbcodec/codecs/libgme/nes_cpu.h +++ b/lib/rbcodec/codecs/libgme/nes_cpu.h @@ -11,13 +11,13 @@ typedef int nes_time_t; typedef int addr_t; enum { page_bits = 11 }; -#define page_size (1 << page_bits) +enum { page_size = 1 << page_bits }; enum { page_count = 0x10000 >> page_bits }; // Unmapped page should be filled with this enum { halt_opcode = 0x22 }; -#define future_time (INT_MAX/2 + 1) +enum { future_time = INT_MAX/2 + 1 }; enum { irq_inhibit_mask = 0x04 }; // Can read this many bytes past end of a page diff --git a/lib/rbcodec/codecs/libgme/nsf_emu.h b/lib/rbcodec/codecs/libgme/nsf_emu.h index d16df5f482..00bdad4a4e 100644 --- a/lib/rbcodec/codecs/libgme/nsf_emu.h +++ b/lib/rbcodec/codecs/libgme/nsf_emu.h @@ -38,8 +38,8 @@ enum { bank_count = fds_banks + 8 }; enum { rom_begin = 0x8000 }; enum { bank_select_addr = 0x5FF8 }; -#define mem_size (0x10000) - +enum { mem_size = 0x10000 }; + // cpu sits here when waiting for next call to play routine enum { idle_addr = 0x5FF6 }; enum { banks_addr = idle_addr }; diff --git a/lib/rbcodec/codecs/libgme/track_filter.h b/lib/rbcodec/codecs/libgme/track_filter.h index 839af6f4a1..3689be9620 100644 --- a/lib/rbcodec/codecs/libgme/track_filter.h +++ b/lib/rbcodec/codecs/libgme/track_filter.h @@ -10,7 +10,7 @@ typedef short sample_t; typedef int sample_count_t; -#define indefinite_count (INT_MAX/2 + 1) +enum { indefinite_count = INT_MAX/2 + 1 }; enum { buf_size = 2048 }; struct setup_t { diff --git a/lib/rbcodec/codecs/libspc/spc_codec.h b/lib/rbcodec/codecs/libspc/spc_codec.h index 0c429323e5..75c344474e 100644 --- a/lib/rbcodec/codecs/libspc/spc_codec.h +++ b/lib/rbcodec/codecs/libspc/spc_codec.h @@ -278,7 +278,7 @@ struct cache_entry_t uint8_t block_header; /* final wave block header */ }; -#define BRR_CACHE_SIZE (0x20000 + 32) +enum { BRR_CACHE_SIZE = 0x20000 + 32}; struct voice_wave_t { @@ -424,7 +424,7 @@ struct Spc_Emu uint8_t boot_rom [ROM_SIZE]; }; -#define SPC_FILE_SIZE (0x10180) +enum { SPC_FILE_SIZE = 0x10180 }; struct spc_file_t { diff --git a/lib/rbcodec/codecs/libwmavoice/avcodec.h b/lib/rbcodec/codecs/libwmavoice/avcodec.h index 962cd946be..db08ab3c5f 100644 --- a/lib/rbcodec/codecs/libwmavoice/avcodec.h +++ b/lib/rbcodec/codecs/libwmavoice/avcodec.h @@ -213,150 +213,149 @@ enum CodecID { CODEC_ID_VP8, CODEC_ID_PICTOR, CODEC_ID_ANSI, -}; -/* enums are 2 bits on some devices */ + /* various PCM "codecs" */ -#define CODEC_ID_PCM_S16LE (0x10000) -#define CODEC_ID_PCM_S16BE (0x10001) -#define CODEC_ID_PCM_U16LE (0x10002) -#define CODEC_ID_PCM_U16BE (0x10003) -#define CODEC_ID_PCM_S8 (0x10004) -#define CODEC_ID_PCM_U8 (0x10005) -#define CODEC_ID_PCM_MULAW (0x10006) -#define CODEC_ID_PCM_ALAW (0x10007) -#define CODEC_ID_PCM_S32LE (0x10008) -#define CODEC_ID_PCM_S32BE (0x10009) -#define CODEC_ID_PCM_U32LE (0x1000A) -#define CODEC_ID_PCM_U32BE (0x1000B) -#define CODEC_ID_PCM_S24LE (0x1000C) -#define CODEC_ID_PCM_S24BE (0x1000D) -#define CODEC_ID_PCM_U24LE (0x1000E) -#define CODEC_ID_PCM_U24BE (0x1000F) -#define CODEC_ID_PCM_S24DAUD (0x10010) -#define CODEC_ID_PCM_ZORK (0x10011) -#define CODEC_ID_PCM_S16LE_PLANAR (0x10012) -#define CODEC_ID_PCM_DVD (0x10013) -#define CODEC_ID_PCM_F32BE (0x10014) -#define CODEC_ID_PCM_F32LE (0x10015) -#define CODEC_ID_PCM_F64BE (0x10016) -#define CODEC_ID_PCM_F64LE (0x10017) -#define CODEC_ID_PCM_BLURAY (0x10018) + CODEC_ID_PCM_S16LE= 0x10000, + CODEC_ID_PCM_S16BE, + CODEC_ID_PCM_U16LE, + CODEC_ID_PCM_U16BE, + CODEC_ID_PCM_S8, + CODEC_ID_PCM_U8, + CODEC_ID_PCM_MULAW, + CODEC_ID_PCM_ALAW, + CODEC_ID_PCM_S32LE, + CODEC_ID_PCM_S32BE, + CODEC_ID_PCM_U32LE, + CODEC_ID_PCM_U32BE, + CODEC_ID_PCM_S24LE, + CODEC_ID_PCM_S24BE, + CODEC_ID_PCM_U24LE, + CODEC_ID_PCM_U24BE, + CODEC_ID_PCM_S24DAUD, + CODEC_ID_PCM_ZORK, + CODEC_ID_PCM_S16LE_PLANAR, + CODEC_ID_PCM_DVD, + CODEC_ID_PCM_F32BE, + CODEC_ID_PCM_F32LE, + CODEC_ID_PCM_F64BE, + CODEC_ID_PCM_F64LE, + CODEC_ID_PCM_BLURAY, /* various ADPCM codecs */ -#define CODEC_ID_ADPCM_IMA_QT (0x11000) -#define CODEC_ID_ADPCM_IMA_WAV (0x11001) -#define CODEC_ID_ADPCM_IMA_DK3 (0x11002) -#define CODEC_ID_ADPCM_IMA_DK4 (0x11003) -#define CODEC_ID_ADPCM_IMA_WS (0x11004) -#define CODEC_ID_ADPCM_IMA_SMJPEG (0x11005) -#define CODEC_ID_ADPCM_MS (0x11006) -#define CODEC_ID_ADPCM_4XM (0x11007) -#define CODEC_ID_ADPCM_XA (0x11008) -#define CODEC_ID_ADPCM_ADX (0x11009) -#define CODEC_ID_ADPCM_EA (0x1100A) -#define CODEC_ID_ADPCM_G726 (0x1100B) -#define CODEC_ID_ADPCM_CT (0x1100C) -#define CODEC_ID_ADPCM_SWF (0x1100D) -#define CODEC_ID_ADPCM_YAMAHA (0x1100E) -#define CODEC_ID_ADPCM_SBPRO_4 (0x1100F) -#define CODEC_ID_ADPCM_SBPRO_3 (0x11010) -#define CODEC_ID_ADPCM_SBPRO_2 (0x11011) -#define CODEC_ID_ADPCM_THP (0x11012) -#define CODEC_ID_ADPCM_IMA_AMV (0x11013) -#define CODEC_ID_ADPCM_EA_R1 (0x11014) -#define CODEC_ID_ADPCM_EA_R3 (0x11015) -#define CODEC_ID_ADPCM_EA_R2 (0x11016) -#define CODEC_ID_ADPCM_IMA_EA_SEAD (0x11017) -#define CODEC_ID_ADPCM_IMA_EA_EACS (0x11018) -#define CODEC_ID_ADPCM_EA_XAS (0x11019) -#define CODEC_ID_ADPCM_EA_MAXIS_XA (0x1101A) -#define CODEC_ID_ADPCM_IMA_ISS (0x1101B) + CODEC_ID_ADPCM_IMA_QT= 0x11000, + CODEC_ID_ADPCM_IMA_WAV, + CODEC_ID_ADPCM_IMA_DK3, + CODEC_ID_ADPCM_IMA_DK4, + CODEC_ID_ADPCM_IMA_WS, + CODEC_ID_ADPCM_IMA_SMJPEG, + CODEC_ID_ADPCM_MS, + CODEC_ID_ADPCM_4XM, + CODEC_ID_ADPCM_XA, + CODEC_ID_ADPCM_ADX, + CODEC_ID_ADPCM_EA, + CODEC_ID_ADPCM_G726, + CODEC_ID_ADPCM_CT, + CODEC_ID_ADPCM_SWF, + CODEC_ID_ADPCM_YAMAHA, + CODEC_ID_ADPCM_SBPRO_4, + CODEC_ID_ADPCM_SBPRO_3, + CODEC_ID_ADPCM_SBPRO_2, + CODEC_ID_ADPCM_THP, + CODEC_ID_ADPCM_IMA_AMV, + CODEC_ID_ADPCM_EA_R1, + CODEC_ID_ADPCM_EA_R3, + CODEC_ID_ADPCM_EA_R2, + CODEC_ID_ADPCM_IMA_EA_SEAD, + CODEC_ID_ADPCM_IMA_EA_EACS, + CODEC_ID_ADPCM_EA_XAS, + CODEC_ID_ADPCM_EA_MAXIS_XA, + CODEC_ID_ADPCM_IMA_ISS, /* AMR */ -#define CODEC_ID_AMR_NB (0x12000) -#define CODEC_ID_AMR_WB (0x12001) + CODEC_ID_AMR_NB= 0x12000, + CODEC_ID_AMR_WB, /* RealAudio codecs*/ -#define CODEC_ID_RA_144 (0x13000) -#define CODEC_ID_RA_288 (0x13001) + CODEC_ID_RA_144= 0x13000, + CODEC_ID_RA_288, /* various DPCM codecs */ -#define CODEC_ID_ROQ_DPCM (0x14000) -#define CODEC_ID_INTERPLAY_DPCM (0x14001) -#define CODEC_ID_XAN_DPCM (0x14002) -#define CODEC_ID_SOL_DPCM (0x14003) + CODEC_ID_ROQ_DPCM= 0x14000, + CODEC_ID_INTERPLAY_DPCM, + CODEC_ID_XAN_DPCM, + CODEC_ID_SOL_DPCM, /* audio codecs */ -#define CODEC_ID_MP2 (0x15000) -#define CODEC_ID_MP3 (0x15001) ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 -#define CODEC_ID_AAC (0x15002) -#define CODEC_ID_AC3 (0x15003) -#define CODEC_ID_DTS (0x15004) -#define CODEC_ID_VORBIS (0x15005) -#define CODEC_ID_DVAUDIO (0x15006) -#define CODEC_ID_WMAV1 (0x15007) -#define CODEC_ID_WMAV2 (0x15008) -#define CODEC_ID_MACE3 (0x15009) -#define CODEC_ID_MACE6 (0x1500A) -#define CODEC_ID_VMDAUDIO (0x1500B) -#define CODEC_ID_SONIC (0x1500C) -#define CODEC_ID_SONIC_LS (0x1500D) -#define CODEC_ID_FLAC (0x1500E) -#define CODEC_ID_MP3ADU (0x1500F) -#define CODEC_ID_MP3ON4 (0x15010) -#define CODEC_ID_SHORTEN (0x15011) -#define CODEC_ID_ALAC (0x15012) -#define CODEC_ID_WESTWOOD_SND1 (0x15013) -#define CODEC_ID_GSM (0x15014) ///< as in Berlin toast format -#define CODEC_ID_QDM2 (0x15015) -#define CODEC_ID_COOK (0x15016) -#define CODEC_ID_TRUESPEECH (0x15017) -#define CODEC_ID_TTA (0x15018 -#define CODEC_ID_SMACKAUDIO (0x15019) -#define CODEC_ID_QCELP (0x1501A) -#define CODEC_ID_WAVPACK (0x1501B) -#define CODEC_ID_DSICINAUDIO (0x1501C) -#define CODEC_ID_IMC (0x1501D) -#define CODEC_ID_MUSEPACK7 (0x1501E) -#define CODEC_ID_MLP (0x1501F) -#define CODEC_ID_GSM_MS (0x15020) /* as found in WAV */ -#define CODEC_ID_ATRAC3 (0x15021) -#define CODEC_ID_VOXWARE (0x15022) -#define CODEC_ID_APE (0x15023) -#define CODEC_ID_NELLYMOSER (0x15024) -#define CODEC_ID_MUSEPACK8 (0x15025) -#define CODEC_ID_SPEEX (0x15026) -#define CODEC_ID_WMAVOICE (0x15027) -#define CODEC_ID_WMAPRO (0x15028) -#define CODEC_ID_WMALOSSLESS (0x15029) -#define CODEC_ID_ATRAC3P (0x1502A) -#define CODEC_ID_EAC3 (0x1502B) -#define CODEC_ID_SIPR (0x1502C) -#define CODEC_ID_MP1 (0x1502D) -#define CODEC_ID_TWINVQ (0x1502E) -#define CODEC_ID_TRUEHD (0x1502F) -#define CODEC_ID_MP4ALS (0x15030) -#define CODEC_ID_ATRAC1 (0x15031) -#define CODEC_ID_BINKAUDIO_RDFT (0x15032) -#define CODEC_ID_BINKAUDIO_DCT (0x15033) + CODEC_ID_MP2= 0x15000, + CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 + CODEC_ID_AAC, + CODEC_ID_AC3, + CODEC_ID_DTS, + CODEC_ID_VORBIS, + CODEC_ID_DVAUDIO, + CODEC_ID_WMAV1, + CODEC_ID_WMAV2, + CODEC_ID_MACE3, + CODEC_ID_MACE6, + CODEC_ID_VMDAUDIO, + CODEC_ID_SONIC, + CODEC_ID_SONIC_LS, + CODEC_ID_FLAC, + CODEC_ID_MP3ADU, + CODEC_ID_MP3ON4, + CODEC_ID_SHORTEN, + CODEC_ID_ALAC, + CODEC_ID_WESTWOOD_SND1, + CODEC_ID_GSM, ///< as in Berlin toast format + CODEC_ID_QDM2, + CODEC_ID_COOK, + CODEC_ID_TRUESPEECH, + CODEC_ID_TTA, + CODEC_ID_SMACKAUDIO, + CODEC_ID_QCELP, + CODEC_ID_WAVPACK, + CODEC_ID_DSICINAUDIO, + CODEC_ID_IMC, + CODEC_ID_MUSEPACK7, + CODEC_ID_MLP, + CODEC_ID_GSM_MS, /* as found in WAV */ + CODEC_ID_ATRAC3, + CODEC_ID_VOXWARE, + CODEC_ID_APE, + CODEC_ID_NELLYMOSER, + CODEC_ID_MUSEPACK8, + CODEC_ID_SPEEX, + CODEC_ID_WMAVOICE, + CODEC_ID_WMAPRO, + CODEC_ID_WMALOSSLESS, + CODEC_ID_ATRAC3P, + CODEC_ID_EAC3, + CODEC_ID_SIPR, + CODEC_ID_MP1, + CODEC_ID_TWINVQ, + CODEC_ID_TRUEHD, + CODEC_ID_MP4ALS, + CODEC_ID_ATRAC1, + CODEC_ID_BINKAUDIO_RDFT, + CODEC_ID_BINKAUDIO_DCT, /* subtitle codecs */ -#define CODEC_ID_DVD_SUBTITLE (0x17000) -#define CODEC_ID_DVB_SUBTITLE (0x17001) -#define CODEC_ID_TEXT (0x17002) ///< raw UTF-8 text -#define CODEC_ID_XSUB (0x17003) -#define CODEC_ID_SSA (0x17004) -#define CODEC_ID_MOV_TEXT (0x17005) -#define CODEC_ID_HDMV_PGS_SUBTITLE (0x17006) -#define CODEC_ID_DVB_TELETEXT (0x17007) -#define CODEC_ID_SRT (0x17008) + CODEC_ID_DVD_SUBTITLE= 0x17000, + CODEC_ID_DVB_SUBTITLE, + CODEC_ID_TEXT, ///< raw UTF-8 text + CODEC_ID_XSUB, + CODEC_ID_SSA, + CODEC_ID_MOV_TEXT, + CODEC_ID_HDMV_PGS_SUBTITLE, + CODEC_ID_DVB_TELETEXT, + CODEC_ID_SRT, /* other specific kind of codecs (generally used for attachments) */ -#define CODEC_ID_TTF (0x18000) + CODEC_ID_TTF= 0x18000, -#define CODEC_ID_PROBE (0x19000) ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it + CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it -#define CODEC_ID_MPEG2TS (0x20000) /**< _FAKE_ codec to indicate a raw MPEG-2 TS + CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS * stream (only used by libavformat) */ }; @@ -1307,7 +1306,7 @@ typedef struct AVCodecContext { char codec_name[32]; enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ - int codec_id; /* see CODEC_ID_xxx */ + enum CodecID codec_id; /* see CODEC_ID_xxx */ /** * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). @@ -2722,7 +2721,7 @@ typedef struct AVCodec { */ const char *name; enum AVMediaType type; - int id; /*enum CodecId*/ + enum CodecID id; int priv_data_size; int (*init)(AVCodecContext *); int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); @@ -2775,7 +2774,7 @@ typedef struct AVHWAccel { * * See CODEC_ID_xxx */ - int id; /*enum CodecID*/ + enum CodecID id; /** * Supported pixel format. @@ -3279,7 +3278,7 @@ void avcodec_register(AVCodec *codec); * @param id CodecID of the requested encoder * @return An encoder if one was found, NULL otherwise. */ -AVCodec *avcodec_find_encoder(int codec_id); +AVCodec *avcodec_find_encoder(enum CodecID id); /** * Find a registered encoder with the specified name. @@ -3295,7 +3294,7 @@ AVCodec *avcodec_find_encoder_by_name(const char *name); * @param id CodecID of the requested decoder * @return A decoder if one was found, NULL otherwise. */ -AVCodec *avcodec_find_decoder(int codec_id); +AVCodec *avcodec_find_decoder(enum CodecID id); /** * Find a registered decoder with the specified name. @@ -3679,7 +3678,7 @@ char av_get_pict_type_char(int pict_type); * @param[in] codec_id the codec * @return Number of bits per sample or zero if unknown for the given codec. */ -int av_get_bits_per_sample(int codec_id); +int av_get_bits_per_sample(enum CodecID codec_id); /** * Return sample format bits per sample. diff --git a/lib/rbcodec/codecs/libwmavoice/internal.h b/lib/rbcodec/codecs/libwmavoice/internal.h index eb5f4744de..24aca6b28b 100644 --- a/lib/rbcodec/codecs/libwmavoice/internal.h +++ b/lib/rbcodec/codecs/libwmavoice/internal.h @@ -40,7 +40,7 @@ int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt); * @param pix_fmt the pixel format to match * @return the hardware accelerated codec, or NULL if none was found. */ -AVHWAccel *ff_find_hwaccel(int codec_id, enum PixelFormat pix_fmt); +AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt); /** * Return the index into tab at which {a,b} match elements {[0],[1]} of tab. diff --git a/lib/rbcodec/codecs/libwmavoice/utils.c b/lib/rbcodec/codecs/libwmavoice/utils.c index c83c77bed1..ad098f4636 100644 --- a/lib/rbcodec/codecs/libwmavoice/utils.c +++ b/lib/rbcodec/codecs/libwmavoice/utils.c @@ -743,12 +743,12 @@ av_cold int avcodec_close(AVCodecContext *avctx) return 0; } -AVCodec *avcodec_find_encoder(int codec_id) +AVCodec *avcodec_find_encoder(enum CodecID id) { AVCodec *p, *experimental=NULL; p = first_avcodec; while (p) { - if (p->encode != NULL && p->id == codec_id) { + if (p->encode != NULL && p->id == id) { if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) { experimental = p; } else @@ -773,12 +773,12 @@ AVCodec *avcodec_find_encoder_by_name(const char *name) return NULL; } -AVCodec *avcodec_find_decoder(int codec_id) +AVCodec *avcodec_find_decoder(enum CodecID id) { AVCodec *p; p = first_avcodec; while (p) { - if (p->decode != NULL && p->id == codec_id) + if (p->decode != NULL && p->id == id) return p; p = p->next; } @@ -1010,7 +1010,7 @@ char av_get_pict_type_char(int pict_type){ } } -int av_get_bits_per_sample(int codec_id){ +int av_get_bits_per_sample(enum CodecID codec_id){ switch(codec_id){ case CODEC_ID_ADPCM_SBPRO_2: return 2; @@ -1150,7 +1150,7 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel) return hwaccel ? hwaccel->next : first_hwaccel; } -AVHWAccel *ff_find_hwaccel(int codec_id, enum PixelFormat pix_fmt) +AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt) { AVHWAccel *hwaccel=NULL; |