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
e06b00f3
Commit
e06b00f3
authored
Aug 19, 2008
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SAMPLE_FMT_DBL.
Originally committed as revision 14832 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4efbd755
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
audioconvert.c
libavcodec/audioconvert.c
+11
-1
avcodec.h
libavcodec/avcodec.h
+2
-1
utils.c
libavcodec/utils.c
+2
-0
No files found.
libavcodec/audioconvert.c
View file @
e06b00f3
...
...
@@ -39,7 +39,8 @@ static const SampleFmtInfo sample_fmt_info[SAMPLE_FMT_NB] = {
[
SAMPLE_FMT_S16
]
=
{
.
name
=
"s16"
,
.
bits
=
16
},
[
SAMPLE_FMT_S24
]
=
{
.
name
=
"s24"
,
.
bits
=
24
},
[
SAMPLE_FMT_S32
]
=
{
.
name
=
"s32"
,
.
bits
=
32
},
[
SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
}
[
SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
},
[
SAMPLE_FMT_DBL
]
=
{
.
name
=
"dbl"
,
.
bits
=
64
},
};
const
char
*
avcodec_get_sample_fmt_name
(
int
sample_fmt
)
...
...
@@ -127,18 +128,27 @@ if(ctx->fmt_pair == ofmt + SAMPLE_FMT_NB*ifmt){\
else
CONV
(
SAMPLE_FMT_S16
,
int16_t
,
SAMPLE_FMT_U8
,
(
*
(
uint8_t
*
)
pi
-
0x80
)
<<
8
)
else
CONV
(
SAMPLE_FMT_S32
,
int32_t
,
SAMPLE_FMT_U8
,
(
*
(
uint8_t
*
)
pi
-
0x80
)
<<
24
)
else
CONV
(
SAMPLE_FMT_FLT
,
float
,
SAMPLE_FMT_U8
,
(
*
(
uint8_t
*
)
pi
-
0x80
)
*
(
1
.
0
/
(
1
<<
7
)))
else
CONV
(
SAMPLE_FMT_DBL
,
double
,
SAMPLE_FMT_U8
,
(
*
(
uint8_t
*
)
pi
-
0x80
)
*
(
1
.
0
/
(
1
<<
7
)))
else
CONV
(
SAMPLE_FMT_U8
,
uint8_t
,
SAMPLE_FMT_S16
,
(
*
(
int16_t
*
)
pi
>>
8
)
+
0x80
)
else
CONV
(
SAMPLE_FMT_S16
,
int16_t
,
SAMPLE_FMT_S16
,
*
(
int16_t
*
)
pi
)
else
CONV
(
SAMPLE_FMT_S32
,
int32_t
,
SAMPLE_FMT_S16
,
*
(
int16_t
*
)
pi
<<
16
)
else
CONV
(
SAMPLE_FMT_FLT
,
float
,
SAMPLE_FMT_S16
,
*
(
int16_t
*
)
pi
*
(
1
.
0
/
(
1
<<
15
)))
else
CONV
(
SAMPLE_FMT_DBL
,
double
,
SAMPLE_FMT_S16
,
*
(
int16_t
*
)
pi
*
(
1
.
0
/
(
1
<<
15
)))
else
CONV
(
SAMPLE_FMT_U8
,
uint8_t
,
SAMPLE_FMT_S32
,
(
*
(
int32_t
*
)
pi
>>
24
)
+
0x80
)
else
CONV
(
SAMPLE_FMT_S16
,
int16_t
,
SAMPLE_FMT_S32
,
*
(
int32_t
*
)
pi
>>
16
)
else
CONV
(
SAMPLE_FMT_S32
,
int32_t
,
SAMPLE_FMT_S32
,
*
(
int32_t
*
)
pi
)
else
CONV
(
SAMPLE_FMT_FLT
,
float
,
SAMPLE_FMT_S32
,
*
(
int32_t
*
)
pi
*
(
1
.
0
/
(
1
<<
31
)))
else
CONV
(
SAMPLE_FMT_DBL
,
double
,
SAMPLE_FMT_S32
,
*
(
int32_t
*
)
pi
*
(
1
.
0
/
(
1
<<
31
)))
else
CONV
(
SAMPLE_FMT_U8
,
uint8_t
,
SAMPLE_FMT_FLT
,
lrintf
(
*
(
float
*
)
pi
*
(
1
<<
7
))
+
0x80
)
else
CONV
(
SAMPLE_FMT_S16
,
int16_t
,
SAMPLE_FMT_FLT
,
lrintf
(
*
(
float
*
)
pi
*
(
1
<<
15
)))
else
CONV
(
SAMPLE_FMT_S32
,
int32_t
,
SAMPLE_FMT_FLT
,
lrintf
(
*
(
float
*
)
pi
*
(
1
<<
31
)))
else
CONV
(
SAMPLE_FMT_FLT
,
float
,
SAMPLE_FMT_FLT
,
*
(
float
*
)
pi
)
else
CONV
(
SAMPLE_FMT_DBL
,
double
,
SAMPLE_FMT_FLT
,
*
(
float
*
)
pi
)
else
CONV
(
SAMPLE_FMT_U8
,
uint8_t
,
SAMPLE_FMT_DBL
,
lrint
(
*
(
double
*
)
pi
*
(
1
<<
7
))
+
0x80
)
else
CONV
(
SAMPLE_FMT_S16
,
int16_t
,
SAMPLE_FMT_DBL
,
lrint
(
*
(
double
*
)
pi
*
(
1
<<
15
)))
else
CONV
(
SAMPLE_FMT_S32
,
int32_t
,
SAMPLE_FMT_DBL
,
lrint
(
*
(
double
*
)
pi
*
(
1
<<
31
)))
else
CONV
(
SAMPLE_FMT_FLT
,
float
,
SAMPLE_FMT_DBL
,
*
(
double
*
)
pi
)
else
CONV
(
SAMPLE_FMT_DBL
,
double
,
SAMPLE_FMT_DBL
,
*
(
double
*
)
pi
)
else
return
-
1
;
}
return
0
;
...
...
libavcodec/avcodec.h
View file @
e06b00f3
...
...
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 51
#define LIBAVCODEC_VERSION_MINOR 6
4
#define LIBAVCODEC_VERSION_MINOR 6
5
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
@@ -348,6 +348,7 @@ enum SampleFormat {
SAMPLE_FMT_S24
,
///< signed 24 bits @deprecated Deprecated in favor of SAMPLE_FMT_S32
SAMPLE_FMT_S32
,
///< signed 32 bits
SAMPLE_FMT_FLT
,
///< float
SAMPLE_FMT_DBL
,
///< double
SAMPLE_FMT_NB
///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
};
...
...
libavcodec/utils.c
View file @
e06b00f3
...
...
@@ -1329,6 +1329,8 @@ int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {
case
SAMPLE_FMT_S32
:
case
SAMPLE_FMT_FLT
:
return
32
;
case
SAMPLE_FMT_DBL
:
return
64
;
default
:
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