File: codecinfo.h

package info (click to toggle)
linux-minidisc 0.9.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,640 kB
  • sloc: ansic: 6,389; cpp: 2,731; python: 2,537; perl: 866; sh: 207; makefile: 10
file content (41 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef ATRAC_H
#define ATRAC_H

#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif

#define CODEC_ATRAC3 0x00
#define CODEC_ATRAC3PLUS_OR_MPEG 0x01
#define CODEC_LPCM 0x80

#define SONY_VIRTUAL_LPCM_FRAMESIZE 64
#define SONY_ATRAC3_SAMPLES_PER_FRAME 1024
#define SONY_ATRAC3P_SAMPLES_PER_FRAME 2048

#define TRACK_IS_MPEG 0
struct sony_codecinfo {
    unsigned char codec_id;
    unsigned char codecinfo[5];
};

unsigned int sony_codecinfo_bytesperframe(const struct sony_codecinfo *ci);
unsigned int sony_codecinfo_samplesperframe(const struct sony_codecinfo *ci);
unsigned long sony_codecinfo_samplerate(const struct sony_codecinfo *ci);
unsigned int sony_codecinfo_kbps(const struct sony_codecinfo *ci);
unsigned int sony_codecinfo_seconds(const struct sony_codecinfo *ci, unsigned int frames);
const char * sony_codecinfo_codecname(const struct sony_codecinfo *ci);
#define sony_codecinfo_is_lpcm(ci) ((ci)->codec_id == CODEC_LPCM)
#define sony_codecinfo_is_at3(ci)  ((ci)->codec_id == CODEC_ATRAC3)
#define sony_codecinfo_is_mpeg(ci) ((ci)->codec_id == CODEC_ATRAC3PLUS_OR_MPEG && \
                                    ((ci)->codecinfo[0] & 3) == 3)
#define sony_codecinfo_is_at3p(ci) ((ci)->codec_id == CODEC_ATRAC3PLUS_OR_MPEG && \
                                    ((ci)->codecinfo[0] & 3) != 3)

#ifdef __cplusplus
}
#endif

#endif