Revision 295ab2af

View differences:

libavcodec/ac3enc.c
44 44
#define SCALE_FLOAT(a, bits) lrintf((a) * (float)(1 << (bits)))
45 45

  
46 46
/** Scale a float value by 2^15, convert to an integer, and clip to int16_t range. */
47
#define FIX15(a) av_clip_int16(SCALE_FLOAT(a, 15))
47
#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
48 48

  
49 49

  
50 50
/**
tests/ref/acodec/ac3
1
464093173530736050e338caf152044c *./tests/data/acodec/ac3.rm
1
8ea1ce311247d27dc653f274ed7104cd *./tests/data/acodec/ac3.rm
2 2
98751 ./tests/data/acodec/ac3.rm
tests/ref/lavf/rm
1
5da8e3db393189708f097cbdddea98f4 *./tests/data/lavf/lavf.rm
1
03427369521c9ebc2a5408a0e2a163bf *./tests/data/lavf/lavf.rm
2 2
346706 ./tests/data/lavf/lavf.rm
tests/ref/seek/ac3_rm
3 3
ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
4 4
ret: 0         st:-1 flags:1  ts: 1.894167
5 5
ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
6
ret: 0         st: 0 flags:0  ts: 0.788000
7
ret: 0         st: 0 flags:1 dts: 2.159000 pts: 2.159000 pos:  35567 size:   556
6
ret:-1         st: 0 flags:0  ts: 0.788000
8 7
ret: 0         st: 0 flags:1  ts:-0.317000
9 8
ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
10
ret:-1         st:-1 flags:0  ts: 2.576668
9
ret: 0         st:-1 flags:0  ts: 2.576668
10
ret: 0         st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos:  48659 size:   558
11 11
ret:-1         st:-1 flags:1  ts: 1.470835
12 12
ret:-1         st: 0 flags:0  ts: 0.365000
13 13
ret: 0         st: 0 flags:1  ts:-0.741000
14 14
ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
15 15
ret: 0         st:-1 flags:0  ts: 2.153336
16 16
ret: 0         st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos:  48659 size:   558
17
ret: 0         st:-1 flags:1  ts: 1.047503
18
ret: 0         st: 0 flags:1 dts: 1.044000 pts: 1.044000 pos:  17349 size:   558
17
ret:-1         st:-1 flags:1  ts: 1.047503
19 18
ret: 0         st: 0 flags:0  ts:-0.058000
20 19
ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
21 20
ret: 0         st: 0 flags:1  ts: 2.836000
22 21
ret: 0         st: 0 flags:1 dts: 2.333000 pts: 2.333000 pos:  38413 size:   556
23
ret: 0         st:-1 flags:0  ts: 1.730004
24
ret: 0         st: 0 flags:1 dts: 1.776000 pts: 1.776000 pos:  29303 size:   558
22
ret:-1         st:-1 flags:0  ts: 1.730004
25 23
ret: 0         st:-1 flags:1  ts: 0.624171
26 24
ret: 0         st: 0 flags:1 dts: 0.417000 pts: 0.417000 pos:   7103 size:   556
27 25
ret: 0         st: 0 flags:0  ts:-0.482000

Also available in: Unified diff