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
8ca6e523
Commit
8ca6e523
authored
Mar 06, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wma: Refactor common code to fix standalone compilation of WMA lossless decoder.
parent
3c715383
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
50 deletions
+102
-50
Makefile
libavcodec/Makefile
+8
-8
wma.c
libavcodec/wma.c
+1
-40
wma.h
libavcodec/wma.h
+0
-2
wma_common.c
libavcodec/wma_common.c
+62
-0
wma_common.h
libavcodec/wma_common.h
+29
-0
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+1
-0
wmaprodec.c
libavcodec/wmaprodec.c
+1
-0
No files found.
libavcodec/Makefile
View file @
8ca6e523
...
@@ -92,8 +92,8 @@ OBJS-$(CONFIG_AVS_DECODER) += avs.o
...
@@ -92,8 +92,8 @@ OBJS-$(CONFIG_AVS_DECODER) += avs.o
OBJS-$(CONFIG_BETHSOFTVID_DECODER)
+=
bethsoftvideo.o
OBJS-$(CONFIG_BETHSOFTVID_DECODER)
+=
bethsoftvideo.o
OBJS-$(CONFIG_BFI_DECODER)
+=
bfi.o
OBJS-$(CONFIG_BFI_DECODER)
+=
bfi.o
OBJS-$(CONFIG_BINK_DECODER)
+=
bink.o
binkdsp.o
OBJS-$(CONFIG_BINK_DECODER)
+=
bink.o
binkdsp.o
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER)
+=
binkaudio.o
wma.o
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER)
+=
binkaudio.o
wma.o
wma_common.o
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER)
+=
binkaudio.o
wma.o
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER)
+=
binkaudio.o
wma.o
wma_common.o
OBJS-$(CONFIG_BMP_DECODER)
+=
bmp.o
msrledec.o
OBJS-$(CONFIG_BMP_DECODER)
+=
bmp.o
msrledec.o
OBJS-$(CONFIG_BMP_ENCODER)
+=
bmpenc.o
OBJS-$(CONFIG_BMP_ENCODER)
+=
bmpenc.o
OBJS-$(CONFIG_BMV_VIDEO_DECODER)
+=
bmv.o
OBJS-$(CONFIG_BMV_VIDEO_DECODER)
+=
bmv.o
...
@@ -419,12 +419,12 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
...
@@ -419,12 +419,12 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o vp56data.o vp56dsp.o \
OBJS-$(CONFIG_VP8_DECODER)
+=
vp8.o
vp8dsp.o
vp56rac.o
OBJS-$(CONFIG_VP8_DECODER)
+=
vp8.o
vp8dsp.o
vp56rac.o
OBJS-$(CONFIG_VQA_DECODER)
+=
vqavideo.o
OBJS-$(CONFIG_VQA_DECODER)
+=
vqavideo.o
OBJS-$(CONFIG_WAVPACK_DECODER)
+=
wavpack.o
OBJS-$(CONFIG_WAVPACK_DECODER)
+=
wavpack.o
OBJS-$(CONFIG_WMALOSSLESS_DECODER)
+=
wmalosslessdec.o
wma.o
OBJS-$(CONFIG_WMALOSSLESS_DECODER)
+=
wmalosslessdec.o
wma
_common
.o
OBJS-$(CONFIG_WMAPRO_DECODER)
+=
wmaprodec.o
wma.o
OBJS-$(CONFIG_WMAPRO_DECODER)
+=
wmaprodec.o
wma.o
wma_common.o
OBJS-$(CONFIG_WMAV1_DECODER)
+=
wmadec.o
wma.o
aactab.o
OBJS-$(CONFIG_WMAV1_DECODER)
+=
wmadec.o
wma.o
wma_common.o
aactab.o
OBJS-$(CONFIG_WMAV1_ENCODER)
+=
wmaenc.o
wma.o
aactab.o
OBJS-$(CONFIG_WMAV1_ENCODER)
+=
wmaenc.o
wma.o
wma_common.o
aactab.o
OBJS-$(CONFIG_WMAV2_DECODER)
+=
wmadec.o
wma.o
aactab.o
OBJS-$(CONFIG_WMAV2_DECODER)
+=
wmadec.o
wma.o
wma_common.o
aactab.o
OBJS-$(CONFIG_WMAV2_ENCODER)
+=
wmaenc.o
wma.o
aactab.o
OBJS-$(CONFIG_WMAV2_ENCODER)
+=
wmaenc.o
wma.o
wma_common.o
aactab.o
OBJS-$(CONFIG_WMAVOICE_DECODER)
+=
wmavoice.o
\
OBJS-$(CONFIG_WMAVOICE_DECODER)
+=
wmavoice.o
\
celp_math.o
celp_filters.o
\
celp_math.o
celp_filters.o
\
acelp_vectors.o
acelp_filters.o
acelp_vectors.o
acelp_filters.o
...
...
libavcodec/wma.c
View file @
8ca6e523
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "avcodec.h"
#include "avcodec.h"
#include "sinewin.h"
#include "sinewin.h"
#include "wma.h"
#include "wma.h"
#include "wma_common.h"
#include "wmadata.h"
#include "wmadata.h"
#undef NDEBUG
#undef NDEBUG
...
@@ -67,46 +68,6 @@ static void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
...
@@ -67,46 +68,6 @@ static void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
av_free
(
level_table
);
av_free
(
level_table
);
}
}
/**
*@brief Get the samples per frame for this stream.
*@param sample_rate output sample_rate
*@param version wma version
*@param decode_flags codec compression features
*@return log2 of the number of output samples per frame
*/
int
av_cold
ff_wma_get_frame_len_bits
(
int
sample_rate
,
int
version
,
unsigned
int
decode_flags
)
{
int
frame_len_bits
;
if
(
sample_rate
<=
16000
)
{
frame_len_bits
=
9
;
}
else
if
(
sample_rate
<=
22050
||
(
sample_rate
<=
32000
&&
version
==
1
))
{
frame_len_bits
=
10
;
}
else
if
(
sample_rate
<=
48000
||
version
<
3
)
{
frame_len_bits
=
11
;
}
else
if
(
sample_rate
<=
96000
)
{
frame_len_bits
=
12
;
}
else
{
frame_len_bits
=
13
;
}
if
(
version
==
3
)
{
int
tmp
=
decode_flags
&
0x6
;
if
(
tmp
==
0x2
)
{
++
frame_len_bits
;
}
else
if
(
tmp
==
0x4
)
{
--
frame_len_bits
;
}
else
if
(
tmp
==
0x6
)
{
frame_len_bits
-=
2
;
}
}
return
frame_len_bits
;
}
int
ff_wma_init
(
AVCodecContext
*
avctx
,
int
flags2
)
int
ff_wma_init
(
AVCodecContext
*
avctx
,
int
flags2
)
{
{
WMACodecContext
*
s
=
avctx
->
priv_data
;
WMACodecContext
*
s
=
avctx
->
priv_data
;
...
...
libavcodec/wma.h
View file @
8ca6e523
...
@@ -150,8 +150,6 @@ extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
...
@@ -150,8 +150,6 @@ extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
extern
const
uint32_t
ff_aac_scalefactor_code
[
121
];
extern
const
uint32_t
ff_aac_scalefactor_code
[
121
];
extern
const
uint8_t
ff_aac_scalefactor_bits
[
121
];
extern
const
uint8_t
ff_aac_scalefactor_bits
[
121
];
int
av_cold
ff_wma_get_frame_len_bits
(
int
sample_rate
,
int
version
,
unsigned
int
decode_flags
);
int
ff_wma_init
(
AVCodecContext
*
avctx
,
int
flags2
);
int
ff_wma_init
(
AVCodecContext
*
avctx
,
int
flags2
);
int
ff_wma_total_gain_to_bits
(
int
total_gain
);
int
ff_wma_total_gain_to_bits
(
int
total_gain
);
int
ff_wma_end
(
AVCodecContext
*
avctx
);
int
ff_wma_end
(
AVCodecContext
*
avctx
);
...
...
libavcodec/wma_common.c
0 → 100644
View file @
8ca6e523
/*
* common code shared by all WMA variants
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/attributes.h"
#include "wma_common.h"
/**
*@brief Get the samples per frame for this stream.
*@param sample_rate output sample_rate
*@param version wma version
*@param decode_flags codec compression features
*@return log2 of the number of output samples per frame
*/
int
av_cold
ff_wma_get_frame_len_bits
(
int
sample_rate
,
int
version
,
unsigned
int
decode_flags
)
{
int
frame_len_bits
;
if
(
sample_rate
<=
16000
)
{
frame_len_bits
=
9
;
}
else
if
(
sample_rate
<=
22050
||
(
sample_rate
<=
32000
&&
version
==
1
))
{
frame_len_bits
=
10
;
}
else
if
(
sample_rate
<=
48000
||
version
<
3
)
{
frame_len_bits
=
11
;
}
else
if
(
sample_rate
<=
96000
)
{
frame_len_bits
=
12
;
}
else
{
frame_len_bits
=
13
;
}
if
(
version
==
3
)
{
int
tmp
=
decode_flags
&
0x6
;
if
(
tmp
==
0x2
)
{
++
frame_len_bits
;
}
else
if
(
tmp
==
0x4
)
{
--
frame_len_bits
;
}
else
if
(
tmp
==
0x6
)
{
frame_len_bits
-=
2
;
}
}
return
frame_len_bits
;
}
libavcodec/wma_common.h
0 → 100644
View file @
8ca6e523
/*
* common code shared by all WMA variants
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_WMA_COMMON_H
#define AVCODEC_WMA_COMMON_H
#include "libavutil/attributes.h"
int
av_cold
ff_wma_get_frame_len_bits
(
int
sample_rate
,
int
version
,
unsigned
int
decode_flags
);
#endif
/* AVCODEC_WMA_COMMON_H */
libavcodec/wmalosslessdec.c
View file @
8ca6e523
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "get_bits.h"
#include "get_bits.h"
#include "put_bits.h"
#include "put_bits.h"
#include "wma.h"
#include "wma.h"
#include "wma_common.h"
/** current decoder limitations */
/** current decoder limitations */
#define WMALL_MAX_CHANNELS 8 ///< max number of handled channels
#define WMALL_MAX_CHANNELS 8 ///< max number of handled channels
...
...
libavcodec/wmaprodec.c
View file @
8ca6e523
...
@@ -97,6 +97,7 @@
...
@@ -97,6 +97,7 @@
#include "fmtconvert.h"
#include "fmtconvert.h"
#include "sinewin.h"
#include "sinewin.h"
#include "wma.h"
#include "wma.h"
#include "wma_common.h"
/** current decoder limitations */
/** current decoder limitations */
#define WMAPRO_MAX_CHANNELS 8 ///< max number of handled channels
#define WMAPRO_MAX_CHANNELS 8 ///< max number of handled channels
...
...
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