Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
c4a6fde3
Commit
c4a6fde3
authored
Oct 14, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3: decode output to float samples instead of converting to s16
parent
f20dd574
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
atrac3.c
libavcodec/atrac3.c
+7
-8
No files found.
libavcodec/atrac3.c
View file @
c4a6fde3
...
@@ -208,7 +208,7 @@ static av_cold void init_atrac3_transforms(ATRAC3Context *q) {
...
@@ -208,7 +208,7 @@ static av_cold void init_atrac3_transforms(ATRAC3Context *q) {
}
}
/* Initialize the MDCT transform. */
/* Initialize the MDCT transform. */
ff_mdct_init
(
&
q
->
mdct_ctx
,
9
,
1
,
1
.
0
);
ff_mdct_init
(
&
q
->
mdct_ctx
,
9
,
1
,
1
.
0
/
32768
);
}
}
/**
/**
...
@@ -825,7 +825,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
...
@@ -825,7 +825,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
ATRAC3Context
*
q
=
avctx
->
priv_data
;
ATRAC3Context
*
q
=
avctx
->
priv_data
;
int
result
=
0
,
i
;
int
result
=
0
,
i
;
const
uint8_t
*
databuf
;
const
uint8_t
*
databuf
;
int16_t
*
samples
=
data
;
float
*
samples
=
data
;
if
(
buf_size
<
avctx
->
block_align
)
{
if
(
buf_size
<
avctx
->
block_align
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
@@ -852,16 +852,15 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
...
@@ -852,16 +852,15 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
if
(
q
->
channels
==
1
)
{
if
(
q
->
channels
==
1
)
{
/* mono */
/* mono */
for
(
i
=
0
;
i
<
1024
;
i
++
)
for
(
i
=
0
;
i
<
1024
;
i
++
)
samples
[
i
]
=
av_clip_int16
(
round
(
q
->
outSamples
[
i
]));
samples
[
i
]
=
q
->
outSamples
[
i
];
*
data_size
=
1024
*
sizeof
(
int16_t
);
}
else
{
}
else
{
/* stereo */
/* stereo */
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
samples
[
i
*
2
]
=
av_clip_int16
(
round
(
q
->
outSamples
[
i
]))
;
samples
[
i
*
2
]
=
q
->
outSamples
[
i
]
;
samples
[
i
*
2
+
1
]
=
av_clip_int16
(
round
(
q
->
outSamples
[
1024
+
i
]))
;
samples
[
i
*
2
+
1
]
=
q
->
outSamples
[
1024
+
i
]
;
}
}
*
data_size
=
2048
*
sizeof
(
int16_t
);
}
}
*
data_size
=
1024
*
q
->
channels
*
av_get_bytes_per_sample
(
avctx
->
sample_fmt
);
return
avctx
->
block_align
;
return
avctx
->
block_align
;
}
}
...
@@ -1014,7 +1013,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
...
@@ -1014,7 +1013,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_
S16
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_
FLT
;
return
0
;
return
0
;
}
}
...
...
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