Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e3d4f59f
Commit
e3d4f59f
authored
Dec 19, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adxenc: remove unneeded comments
parent
96d8e18a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
38 deletions
+2
-38
adxenc.c
libavcodec/adxenc.c
+2
-38
No files found.
libavcodec/adxenc.c
View file @
e3d4f59f
...
...
@@ -33,8 +33,6 @@
* adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
*/
/* 18 bytes <-> 32 samples */
static
void
adx_encode
(
ADXContext
*
c
,
unsigned
char
*
adx
,
const
short
*
wav
,
ADXChannelState
*
prev
)
{
...
...
@@ -60,8 +58,6 @@ static void adx_encode(ADXContext *c, unsigned char *adx, const short *wav,
prev
->
s1
=
s1
;
prev
->
s2
=
s2
;
/* -8..+7 */
if
(
max
==
0
&&
min
==
0
)
{
memset
(
adx
,
0
,
18
);
return
;
...
...
@@ -82,35 +78,12 @@ static void adx_encode(ADXContext *c, unsigned char *adx, const short *wav,
static
int
adx_encode_header
(
AVCodecContext
*
avctx
,
unsigned
char
*
buf
,
size_t
bufsize
)
{
#if 0
struct {
uint32_t offset; /* 0x80000000 + sample start - 4 */
unsigned char unknown1[3]; /* 03 12 04 */
unsigned char channel; /* 1 or 2 */
uint32_t freq;
uint32_t size;
uint32_t unknown2; /* 01 f4 03 00 */
uint32_t unknown3; /* 00 00 00 00 */
uint32_t unknown4; /* 00 00 00 00 */
/* if loop
unknown3 00 15 00 01
unknown4 00 00 00 01
long loop_start_sample;
long loop_start_byte;
long loop_end_sample;
long loop_end_byte;
long
*/
} adxhdr; /* big endian */
/* offset-6 "(c)CRI" */
#endif
ADXContext
*
c
=
avctx
->
priv_data
;
AV_WB32
(
buf
+
0x00
,
0x80000000
|
0x20
);
AV_WB32
(
buf
+
0x04
,
0x03120400
|
avctx
->
channels
);
AV_WB32
(
buf
+
0x08
,
avctx
->
sample_rate
);
AV_WB32
(
buf
+
0x0c
,
0
);
/* FIXME: set after */
AV_WB32
(
buf
+
0x0c
,
0
);
AV_WB16
(
buf
+
0x10
,
c
->
cutoff
);
AV_WB32
(
buf
+
0x12
,
0x03000000
);
AV_WB32
(
buf
+
0x16
,
0x00000000
);
...
...
@@ -124,14 +97,12 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
ADXContext
*
c
=
avctx
->
priv_data
;
if
(
avctx
->
channels
>
2
)
return
-
1
;
/* only stereo or mono =) */
return
-
1
;
avctx
->
frame_size
=
32
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
->
key_frame
=
1
;
// avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;
/* the cutoff can be adjusted, but this seems to work pretty well */
c
->
cutoff
=
500
;
ff_adx_calculate_coeffs
(
c
->
cutoff
,
avctx
->
sample_rate
,
COEFF_BITS
,
c
->
coeff
);
...
...
@@ -156,13 +127,6 @@ static int adx_encode_frame(AVCodecContext *avctx,
unsigned
char
*
dst
=
frame
;
int
rest
=
avctx
->
frame_size
;
/*
input data size =
avconv.c:do_audio_out()
frame_bytes = enc->frame_size * 2 * enc->channels;
*/
// printf("sz=%d ",buf_size); fflush(stdout);
if
(
!
c
->
header_parsed
)
{
int
hdrsize
=
adx_encode_header
(
avctx
,
dst
,
buf_size
);
dst
+=
hdrsize
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment