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
39b60944
Commit
39b60944
authored
Mar 20, 2009
by
Benjamin Larsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of av_random in cook.c
Originally committed as revision 18079 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3b0b8479
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
cook.c
libavcodec/cook.c
+5
-4
No files found.
libavcodec/cook.c
View file @
39b60944
...
...
@@ -46,7 +46,8 @@
#include <stddef.h>
#include <stdio.h>
#include "libavutil/random.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
...
...
@@ -110,7 +111,7 @@ typedef struct cook {
int
bits_per_subpacket
;
int
cookversion
;
/* states */
AV
RandomState
random_state
;
AV
LFG
random_state
;
/* transform data */
MDCTContext
mdct_ctx
;
...
...
@@ -541,7 +542,7 @@ static void scalar_dequant_float(COOKContext *q, int index, int quant_index,
}
else
{
/* noise coding if subband_coef_index[i] == 0 */
f1
=
dither_tab
[
index
];
if
(
av_
random
(
&
q
->
random_state
)
<
0x80000000
)
f1
=
-
f1
;
if
(
av_
lfg_get
(
&
q
->
random_state
)
<
0x80000000
)
f1
=
-
f1
;
}
mlt_p
[
i
]
=
f1
*
rootpow2tab
[
quant_index
+
63
];
}
...
...
@@ -1066,7 +1067,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q
->
bit_rate
=
avctx
->
bit_rate
;
/* Initialize RNG. */
av_
random_init
(
&
q
->
random_state
,
1
);
av_
lfg_init
(
&
q
->
random_state
,
ff_random_get_seed
()
);
/* Initialize extradata related variables. */
q
->
samples_per_channel
=
q
->
samples_per_frame
/
q
->
nb_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