1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Compare commits

...

3534 commits

Author SHA1 Message Date
winlin
e3d74fb045 Release v5.0-r3 and v6.0-d5. 2024-06-15 17:33:45 +08:00
Winlin
e7069788e9
SmartPtr: Support shared ptr for live source. v6.0.129 (#4089)
Detail change log:

1. [Simple,Refactor] Remove member fields of http entry, etc.
e34b3d3aa4
2. [Ignore] Rename source to live_source.
846f95ec96
3. [Ignore] Use directly ptr in consumer.
d38af021ad
4. [Complex, Important] Use shared ptr for live source.
88f922413a

The object relationship:

![live-source](1adb59af-6e7a-40f3-9a4a-1cc849d7dae1)

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-15 07:54:56 +08:00
Jacob Su
908c2f2a30
Fix hevc test failures (#4087)
Try to fix two blackbox test:
1. TestSlow_SrtPublish_HttpTsPlay_HEVC_Basic: fixed by enlarge the wait
time from 3 seconds to 4 before run ffprobe task, which will record the
stream by ffmpeg first.
2 TestSlow_SrtPublish_HlsPlay_HEVC_Basic: fixed by wait 16 seconds
before run ffprobe task.
About the 2 case: it seems ridiculous to add 16 seconds delay before run
ffprobe task.

> So, I start #4088 to check the github action workflow process, I start
this branch from a very earlier version `6.0.113
(srs/core/srs_core_version6.hpp)`, what I found it that, inside `SRS
blackbox-test`, the srs version `6.0.128`, the latest version, was
printed. That's really wired.

I confirmed this is not the SRS source code's problem, check
2621802555
the srs code 6.0.113 was checkout and running actions based on them,
still met same problem.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-06-14 18:56:07 +08:00
Winlin
9dba99a1cc
SmartPtr: Support shared ptr for RTC source. v6.0.128 (#4085)
---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2024-06-14 08:07:26 +08:00
Winlin
242152bd6b
SmartPtr: Use shared ptr in RTC TCP connection. v6.0.127 (#4083)
Fix issue https://github.com/ossrs/srs/issues/3784

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-13 16:04:31 +08:00
Winlin
7b9c52b283
SmartPtr: Support shared ptr for SRT source. (#4084)
---

Co-authored-by: Haibo Chen <495810242@qq.com>
2024-06-13 14:44:09 +08:00
Winlin
6834ec208d
SmartPtr: Use shared ptr to manage GB objects. v6.0.126 (#4080)
The object relations: 

![gb](266e8a4e-3f1e-4805-8406-9008d6a63aa0)

Session manages SIP and Media object using shared resource or shared
ptr. Note that I actually use SrsExecutorCoroutine to delete the object
when each coroutine is done, because there is always a dedicate
coroutine for each object.

For SIP and Media object, they directly use the session by raw pointer,
it's safe because session always live longer than session and media
object.

---

Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-12 22:40:20 +08:00
Jacob Su
1656391c67
RTC: Support dropping h.264 SEI from NALUs. v5.0.213 v6.0.125 (#4057)
try to fix #4052.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-06-03 16:25:49 +08:00
johzzy
282d94d7bb
HEVC: Fix duplicated error code 4054 and 4055. (#4044)
Correct SRS_ERRNO_MAP_HTTP duplicate error code 4054 and 4055.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-04-26 07:53:01 +08:00
Winlin
37f0faae5a
RTMP: Do not response publish start message if hooks fail. v5.0.212 v6.0.123 (#4038)
Fix #4037 SRS should not send the publish start message
`onStatus(NetStream.Publish.Start)` if hooks fail, which causes OBS to
repeatedly reconnect.

Note that this fix does not send an RTMP error message when publishing
fails, because neither OBS nor FFmpeg process this specific error
message; they only display a general error.

Apart from the order of messages, nothing else has been changed.
Previously, we sent the publish start message
`onStatus(NetStream.Publish.Start)` before the HTTP hook `on_publish`;
now, we have modified it to send this message after the HTTP hook.
2024-04-23 15:21:36 +08:00
Jacob Su
5eb802daca
Support x509 certification chiain in single pem file. v5.0.211 v6.0.122 (#4033)
Fix #3967 There is an API `SSL_use_certificate_chain_file`, which can load the
certification chain and also single certificate.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-04-22 10:15:11 +08:00
winlin
427104f1da Release v5.0-r2, 5.0 release2, v5.0.210, 163515 lines. 2024-04-03 15:06:20 +08:00
Winlin
244ce7bc01
Merge pull request from GHSA-gv9r-qcjc-5hj7
* Filter JSONP callback function name. v5.0.210,v6.0.121

* Add utest.

* Refine utest
2024-03-26 19:30:52 +08:00
Jacob Su
08971e5905
Build: Refine workflow for cygwin and remove scorecard. v6.0.120 (#3995)
#3983 already fixed the `test` workflow, but I think the `release` will
have same issue.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-03-26 16:37:33 +08:00
Jacob Su
2199fd2b88
Build: Fix module failed for main_ingest_hls and mp4_parser. v6.0.119 (#4005)
1. fix src/main/srs_main_ingest_hls.cpp compiling error;
2. fix src/main/srs_main_mp4_parser.cpp compiling error;
3. remove empty target srs_ingest_hls;

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-03-26 16:26:12 +08:00
Winlin
ff91757a3a
ST: Research adds examples that demos pthread and helloworld. v6.0.118 (#3989)
1. `trunk/research/st/exceptions.cpp` About exceptions with ST, works
well on linux and mac, not work on cygwin.
2. `trunk/research/st/pthreads.cpp` About pthreads with ST, works well
on all platforms.
3. `trunk/research/st/hello.cpp` Hello world, without ST, works well on
all platforms.
4. `trunk/research/st/hello-world.cpp` Hello world, with ST, works well
on all platforms.
5. `trunk/research/st/hello-st.cpp` A very simple version for hello
world with ST, works well on all platforms.
2024-03-24 09:28:46 +08:00
Winlin
ce2ce1542f
Add a TCP proxy for debugging. v6.0.117 (#3958)
When debugging the RTMP protocol, we can capture packets using tcpdump
and then replay the pcap file. For example:

```bash
cd ~/git/srs/trunk/3rdparty/srs-bench/pcap
tcpdump -i any -w t.pcap tcp port 1935
go run . -f ./t.pcap -s 127.0.0.1:1935
```

However, sometimes due to poor network conditions between the server and
the client, there may be many retransmitted packets. In such cases,
setting up a transparent TCP proxy that listens on port 1935 and
forwards to port 19350 can be a solution:

```bash
./objs/srs -c conf/origin.conf 
cd 3rdparty/srs-bench/tcpproxy/ && go run main.go
tcpdump -i any -w t.pcap tcp port 19350
```

This approach allows for the implementation of packet dumping,
multipoint replication, or the provision of detailed timestamps and byte
information at the proxy. It enables the collection of debugging
information without the need to modify the server.



---------

`TRANS_BY_GPT4`

---------

Co-authored-by: john <hondaxiao@tencent.com>
2024-03-19 21:10:10 +08:00
Winlin
26f4ab9923
WebRTC: Add support for A/V only WHEP/WHEP player. v6.0.116 (#3964)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2024-03-19 21:08:03 +08:00
Winlin
b891c8b587
Disable patreon in FUNDING.yml 2024-03-19 20:00:01 +08:00
Winlin
84b184dd53
System: Disable feature that obtains versions and check features status. v5.0.209 v6.0.115 (#3990)
See https://github.com/ossrs/srs/issues/2424

---------

Co-authored-by: john <hondaxiao@tencent.com>
2024-03-19 19:12:41 +08:00
Jacob Su
954b1b7ef2
Typo: Fix some typos for #3973 #3976 #3982. v6.0.114 (#3973) 2024-03-18 10:17:00 +08:00
winlin
fa8096ad01 Release v6.0-d4, 6.0 dev4, v6.0.113, 167695 lines. 2024-02-15 21:04:00 +08:00
Winlin
7209b73660
WHIP: Fix bug for converting WHIP to RTMP/HLS. v5.0.208 v6.0.113 (#3920)
1. When converting RTC to RTMP, it is necessary to synchronize the audio
and video timestamps. When the synchronization status changes, whether
it is unsynchronized or synchronized, print logs to facilitate
troubleshooting of such issues.
2. Chrome uses the STAP-A packet, which means a single RTP packet
contains SPS/PPS information. OBS WHIP, on the other hand, sends SPS and
PPS in separate RTP packets. Therefore, SPS and PPS are in two
independent RTP packets, and SRS needs to cache these two packets.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2024-02-06 14:06:34 +08:00
Winlin
22c2469414
Upgrade hls.js and set in low latency mode. v6.0.112 (#3924)
HLS typically has a delay of around 30 seconds, roughly comprising three
segments, each lasting 10 seconds. We can reduce the delay to about 5
seconds by lowering the segment duration to 2 seconds and starting
playback from the last segment, achieving a stable delay.

Of course, this requires setting the OBS's GOP to 1 second, and the
profile to baseline, preset to fast, and tune to zerolatency.
Additionally, updating a few configurations in the hls.js player is
necessary, such as setting it to start playback from the last segment,
setting the maximum buffer, and initiating accelerated playback to
reduce latency.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2024-02-05 21:37:29 +08:00
Jay
4ca7684e36
RTC: Fix video and audio track pt_ is not change in player before publisher. v5.0.207 v6.0.111 (#3925)
For WebRTC:
when player before publisher, it will happen track pt didn't change.

 - At source change step, change track pt 

---------

Co-authored-by: mingche.tsai <w41203208.work@gmail.com>
Co-authored-by: john <hondaxiao@tencent.com>
2024-02-05 15:15:06 +08:00
john
77af3dc8c4
Configure: print enabled/disable sanitizer. v5.0.206 v6.0.110 (#3923)
---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2024-02-05 12:14:22 +08:00
winlin
d7248bbb0e Update the template for issues. 2024-02-02 19:29:05 +08:00
winlin
2a2da2253f Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
Haibo Chen
8f70206a3b
Enhancing the compatibility of options.sh. v5.0.204 v6.0.108 (#3916)
Accommodate certain complex parameters that include the "=" character,
for example.
`configure --extra-flags="-O2 -D_FORTIFY_SOURCE=2"`

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-12-30 09:08:41 +08:00
chundonglinlin
804ef3f98c
Forward: when unpublish crash caused by uninitialized forward connection. v6.0.107 (#3914)
Description
A crash occurs when a forward relay connection has not been established
and an unpublish event is triggered simultaneously. For instance, if DVR
and forward are configured with a specified DVR path that already
exists, initiating a stream will trigger a crash.

Objective
Fix the crash caused by the forward mechanism.

Additional Information
For detailed reproduction steps, please refer to issue #3901.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-12-30 09:05:55 +08:00
winlin
360aaaf9e4 Fix version bug. 2023-12-30 09:04:38 +08:00
Winlin
1b99fcbe79
A demo for SRT proxy. (#3869)
See https://www.figma.com/file/kItb5HWOI4HimjDp62pas3/SRT-Proxy
2023-12-30 08:55:01 +08:00
Winlin
ad7ddde318
Fix DO droplet link bug. 2023-12-23 20:30:26 +08:00
Laurentiu
2f95f2ae6a
Typo: line 263 - srs_app_srt_conn.cpp. v6.0.106 (#3854)
regards,
laur
---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-12-15 23:13:16 +08:00
john
15601b4b2a
RTC: Support OPUS stereo SDP option. v5.0.203 v6.0.105 (#3910)
In an SDK that supports RTC Opus stereo, the parameter "stereo=1" may
appear. SRS (Spatial Reference System) needs to handle this correctly
and return an answer to enable WebRTC stereo support.



---------

`TRANS_BY_GPT4`
2023-12-14 23:29:22 +08:00
Haibo Chen
6d56c407c6
Security: Support IP whitelist for HTTP-FLV, HLS, WebRTC, and SRT. v5.0.202 v6.0.104 (#3902)
Security is the built-in IP whitelist feature of SRS, which allows and
denies certain IP and IP range users. Previously, it only supported
RTMP, but this PR now supports HTTP-FLV, HLS, WebRTC, SRT, and other
protocols.

See https://ossrs.io/lts/en-us/docs/v6/doc/security as example.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-12-14 21:36:06 +08:00
Haibo Chen
1b34fc4d4e
fix 'sed' error in options.sh. v5.0.201 v6.0.103 (#3891)
The `-` character, when placed in the middle of a regular expression, is
interpreted as a range. It must be placed at the beginning or end to be
interpreted as a literal character.

---------

`TRANS_BY_GPT4`

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-11-23 13:29:49 +08:00
john
3e463a8e56
Fix opus delay options, use ffmpeg-opus in docker test. v6.0.102 (#3883)
The `ffmpeg-opus` tool allows you to control the delay using the
`opus_delay` option. The minimum delay can be set to 2.5ms. However, in
practice, you cannot set it this low. You need to set at least 10 frames
to allow the audio encoder to lookahead. Otherwise, the sound will be
distorted.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-11-22 14:58:30 +08:00
winlin
470a373a68 Release v6.0-d3, 6.0 dev3, v6.0.101, 167560 lines. 2023-11-19 22:00:43 +08:00
Winlin
8865ddd4bb
Change the hls_aof_ratio to 2.1. v5.0.200 v6.0.101 (#3886)
In pure audio mode, there are no keyframes. Therefore, we can only rely
on the length of the slice to determine whether it should be output.
`hls_aof_ratio` is the coefficient that, once reached, will generate a
new slice.

In scenarios with video, if the `hls_aof_ratio` is too small, for
example 1.2, and the GOP (Group of Pictures) is 10 seconds, then a slice
will definitely be generated at 12 seconds. At this point, if there are
no keyframes, it will cause the next slice to start with a non-keyframe.

A safer coefficient is twice the GOP (Group of Pictures). This way, it
won't trigger incorrectly and prevent the individual transcoding of a ts
segment file.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-11-19 21:50:11 +08:00
john
24235d8b6a
Fix the test fail when enable ffmpeg-opus. v6.0.100 (#3868)
1. After enabling FFmpeg opus, the transcoding time for each opus packet
is around 4ms.
2. To speed up case execution, our test publisher sends 400 opus packets
at intervals of 1ms.
3. After the publisher starts, wait for 30ms, then the player starts.
4. Due to the lengthy processing time for each opus packet, SRS
continuously receives packets from the publisher, so it doesn't switch
coroutines and can't accept the player's connection.
5. Only after all opus packets are processed will it accept the player
connection. Therefore, the player doesn't receive any data, leading to
the failure of the case.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2023-11-16 18:17:04 +08:00
Haibo Chen
a2324a620a
Support configure with --extra-ldflags. v5.0.199 v6.0.99 (#3879)
1. add --extra-ldflags
2. support  commas in configure file
3. support link system library for utest

```
./configure --extra-ldflags=-Wl,-z,now
```
2023-11-15 17:43:29 +08:00
Haibo Chen
4372e32f72
Don't compile libopus when enable sys-ffmpeg. v5.0.198 v6.0.98 (#3851) 2023-11-06 14:46:58 +08:00
winlin
b8734cb462 Disable ffmpeg-opus by default. v6.0.97 2023-11-06 09:39:34 +08:00
chundonglinlin
e7b629cd39
RTC: Refine FFmpeg opus audio noisy issue. v5.0.197 v6.0.97 (#3852)
### Description

When converting between AAC and Opus formats (aac2opus or opus2aac), the
`av_frame_get_buffer` API is frequently called.

### Objective

The goal is to optimize the code logic and reduce the frequent
allocation and deallocation of memory.

In the case of aac2opus, av_frame_get_buffer is still frequently called.
In the case of opus2aac, the goal is to avoid calling
av_frame_get_buffer and reduce memory allocations.

### Additional Note

Before calling the `av_audio_fifo_read` API, use
`av_frame_make_writable` to check if the frame is writable. If it is not
writable, create a new frame.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-11-04 16:21:44 +08:00
chundonglinlin
4a100616fc
Support build without cache to test if actions fail. v5.0.196 v6.0.96 (#3858)
By default, caching is enabled during compilation, which means that data
is cached in Docker. This helps to avoid compiling third-party
dependency libraries. However, sometimes when updating third-party
libraries, it's necessary to disable caching to temporarily verify if
the pipeline can succeed. Therefore, a configure option should be added.
When this option is enabled, the compilation cache will not be used, and
all third-party libraries will be compiled from scratch.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2023-11-01 17:47:52 +08:00
winlin
1840476fe0 Update README for v5.0-b6, 5.0 beta6, v5.0.195 2023-10-25 20:45:10 +08:00
john
9238f09b0b
RTC: Fix FFmpeg opus audio noisy issue. v5.0.195 v6.0.95 (#3845)
Follow the example in FFmpeg's doc, before calling the API
`avcodec_send_frame`, always use `av_frame_alloc` to create a new frame.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-10-25 11:55:32 +08:00
chundonglinlin
9b07d840ed
WebRTC: TCP transport should use read_fully instead of read. v5.0.194 v6.0.94 (#3847)
SRS supports TCP WebRTC by reading 2 bytes of length, like `read(buf,
2)`. However, in some cases, it might receive 1 byte, causing subsequent
data to be incorrect and making it unable to push or play streams.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-23 14:52:34 +08:00
winlin
29eff1a242 Refine LICENSE. 2023-10-23 14:33:19 +08:00
winlin
9a6f5f04f5 Refine LICENSE. 2023-10-23 14:26:17 +08:00
Haibo Chen
9183e05ef0
Added system library option for ffmpeg, srtp, srt libraries. v5.0.193 v6.0.93 (#3846)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-20 22:32:11 +08:00
Winlin
4e7c075559
Disable asan by default. v5.0.192 v6.0.92 (#3840)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-17 10:03:44 -05:00
Winlin
bb94d0ff2f
Support set the ice-ufrag and ice-pwd for connectivity check. v5.0.191 v6.0.91 (#3837)
Checking the HTTPS API or UDP connectivity for WHIP tests can be
difficult. For example, if the UDP port isn't available but the API is
fine, OBS only says it can't connect to the server. It's hard to see the
HTTPS API response or check if the UDP port is available.

This feature lets you set the ice username and password in SRS. You can
then send a STUN request using nc and see the response, making it easier
to check UDP port connectivity.

1. Use curl to test the WHIP API, including ice-frag and ice-pwd
queries.
2. Use nc to send a STUN binding request to test UDP connectivity.
3. If both the API and UDP are working, you should get a STUN response.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-17 09:32:48 -05:00
Winlin
a458c9c68d
Refine docker detect mechenism. v5.0.190 v6.0.90 (#3758)
When using Docker, logs are usually printed to console (stdout and
stderr). However, since Docker detection occurs late, after log
initialization, the default log output may be incorrect. In Docker, logs
may still be written to a file instead of the console as expected.

Additionally, the Dockerfile has been improved with a new environment
variable `SRS_IN_DOCKER=on` to clearly indicate a Docker environment. If
automatic Docker detection fails, the configuration will be read, and
this variable will correctly inform SRS that it's in a Docker
environment.

Lastly, the default configuration values have been improved for Docker
environments. By default, `SRS_LOG_TANK=console` and daemon mode is
disabled.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-17 08:24:12 -05:00
VampireAchao
c91e3a36c2
Refactor: Update the badge to SRS. (#3841) 2023-10-17 17:49:20 +08:00
Haibo Chen
0649a6d400
Fix bug for upgrading to OpenSSL 3.0. v5.0.189 v6.0.89 (#3827)
The fix is for the DH_set_length error. As shown in lines 2-5, OpenSSL
3.0 added a check for length, which allowed this issue to be exposed.
```
1 if (dh->params.q == NULL) {
2       /* secret exponent length, must satisfy 2^(l-1) <= p */
3        if (dh->length != 0
4            && dh->length >= BN_num_bits(dh->params.p))
5            goto err;
6        l = dh->length ? dh->length : BN_num_bits(dh->params.p) - 1;
7        if (!BN_priv_rand_ex(priv_key, l, BN_RAND_TOP_ONE,
8                             BN_RAND_BOTTOM_ANY, 0, ctx))
9            goto err;
        ... ...
    }
```


---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-11 07:50:32 -05:00
Winlin
40e5962bec
SRT: Fix the missing config mss. v5.0.188 v6.0.88 (#3825)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-10 07:10:58 -05:00
Winlin
a1e4f61dd3
Solve the problem of inaccurate HLS TS duration. v5.0.187 v6.0.87 (#3824)
1. The comment on the ratio configuration says it can affect the slice
duration, but there is no effect after configuring it.
2. The default hls_td_ratio is 1.5, and after setting it to 1, the
duration is still slightly more than 10 seconds.
3. Even if the GOP is an integer, like 1 second, the slice is still a
non-integer, like 0.998 seconds, which seems a bit unreliable.
4. In the duration of the TS in the m3u8 file, it is one frame less than
the duration of the slice.
5. Set hls_dispose to 120s to dispose HLS files when no stream.
6. Use docker.conf for docker.

Before this patch:

```
#EXTINF:10.983, no desc
livestream-0.ts?hls_ctx=3p095hq0
```

After this patch:

```
#EXTINF:10.000, no desc
livestream-0.ts?hls_ctx=3p095hq0
```

Note: If the fragment is set to 10 seconds, but the GOP size cannot be
divided by 10, such as not 1, 2, 5, or 10, then the duration of ts will
still be more than 10 seconds.


---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-09 06:22:41 -05:00
Winlin
d10e16e335
Use new cache image name. v6.0.86 (#3815)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-10-08 07:43:14 -05:00
winlin
411ae5aff7 Update README, use docker by default. 2023-09-28 11:41:42 +08:00
winlin
1f6565ec9b Update contributors. 2023-09-28 11:03:34 +08:00
winlin
f4d75543a7 Release v6.0-d2, 6.0 dev2, v6.0.85, 167509 lines. 2023-09-28 09:54:55 +08:00
Haibo Chen
ca155a5b58
Turn off the related utests H265 option. v6.0.85 (#3811)
Turn off related unit tests when the H265 option is also turned off.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-09-26 20:28:44 +08:00
winlin
42bd4a9fb8 Update the ISSUE TEMPALTE. 2023-09-26 09:34:29 +08:00
Winlin
a52080171d
Change dev code for John. v6.0.84 (#3810)
Update dev code for SRS 6.0, see
https://ossrs.io/lts/en-us/product#release-60

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-09-25 09:39:30 +08:00
terrencetang2023
5b31225d7c
Build: Check __GLIBC__ for OpenHarmony to fix build fail. v6.0.83 (#3777)
When I compile on OpenHarmony, I encounter an error at the
pthread_setname_np function:
```
./src/app/srs_app_threads.cpp:53:10: error: functions that differ only in their return type cannot be overloaded
void pthread_setname_np(pthread_t trd, const char* name) {
/data/local/ohos-sdk/linux/native/llvm/bin/../../sysroot/usr/include/pthread.h:379:5: note: previous declaration is here
int pthread_setname_np(pthread_t, const char *);
```

Our libc is using musl-libc and has no defined __GLIBC__, so we wanted
to add a judgment that __GLIBC__ already defined.
2023-09-22 09:44:29 +08:00
Haibo Chen
fbb8c16496
Build: Support sys-ssl for srt. v5.0.184 v6.0.82 (#3806)
support sys-ssl for srt

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-09-21 23:04:38 +08:00
Haibo Chen
c5e067fb0b
Upgrade libsrt to v1.5.3. v5.0.183 v6.0.81 (#3808)
fix https://github.com/ossrs/srs/issues/3155
Build srt-1-fit fails with `standard attributes in middle of
decl-specifiers` on GCC 12,Arch Linux.

See https://github.com/Haivision/srt/releases/tag/v1.5.3
2023-09-21 22:23:56 +08:00
Winlin
f9bba0a9b0
WebRTC: Support WHEP for play. v5.0.182 v6.0.80 (#3404)
RFC for WHIP: https://datatracker.ietf.org/doc/draft-ietf-wish-whip/

RFC for WHEP: https://datatracker.ietf.org/doc/draft-murillo-whep/

Please note that SRS 5.0 already had WHIP support. I didn't write a
document about WHIP, because WHIP is not a RFC right now, but there are
clues in
[srs-unity](https://github.com/ossrs/srs-unity#usage-publisher). SRS
WHIP url for publisher:
`http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream`

This PR is for WHEP, the url for player is
`http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream`

PS: There is a great PR for OBS to have WHIP support, see
https://github.com/obsproject/obs-studio/pull/7926 and #3581

PS: WHIP for FFmpeg https://github.com/ossrs/ffmpeg-webrtc/pull/1

See #3170


---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-09-21 18:41:33 +08:00
john
03d1d91f2f
Prevent the output of srt logs in utest. v5.0.181 v6.0.79 (#3807)
Prevent the output of srt logs in utest.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-09-21 15:37:24 +08:00
john
8c67889860
SRT: Log level to debug when no socket to accept. v5.0.180 v6.0.78 (#3696) 2023-09-21 15:10:23 +08:00
Winlin
6a4ace900d
Support FFmpeg timecode, fix AMF0 parsing failed. v5.0.179 v6.0.77 (#3804)
Please see https://github.com/ossrs/srs/issues/3803 for detail:

1. When using FFmpeg with the `-map 0` option, there may be a 4-byte
timecode in the AMF0 Data.
2. SRS should be able to handle this packet without causing a parsing
error, as it's generally expected to be an AMF0 string, not a 4-byte
timecode.
3. Disregard the timecode since SRS doesn't utilize it.

See [Error submitting a packet to the muxer: Broken pipe, Error muxing a
packet](https://trac.ffmpeg.org/ticket/10565)

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-09-18 13:48:07 +08:00
qyt
4362df743b Bugfix: HEVC SRT stream supports multiple PPS fields. v6.0.76 (#3722)
When the srs have multiple pps in hevc.the srs can't parse for this.
problem fixed this #3604

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-09-18 10:58:05 +08:00
Mr. Li
add0f369c5 Fix RBSP issue, where 0x03 should be removed. v5.0.178 v6.0.75 (#3597)
ISO_IEC_14496-10-AVC-2012.pdf, page 65
7.4.1.1 Encapsulation of an SODB within an RBSP (informative)

... 00 00 03 xx, the 03 byte should be drop where xx represents any 2
bit pattern: 00, 01, 10, or 11.

---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlin@vip.126.com>
2023-09-09 08:58:38 +08:00
Winlin
6f42ca67cb
Support SRS Stack token for authentication. v6.0.74 (#3794)
When accessing the SRS Stack, you should log in and use a token for each
request, or utilize the HTTP API with a secret Bearer token included in
every request. The SRS Stack HTTP API proxies both /api/v1 and /rtc/v1
to the SRS HTTP API while ensuring secure authentication. Additionally,
there is a console in the SRS Stack that requires the same token to
request the SRS Stack HTTP API, which is then proxied to the SRS HTTP
API.

The SRS Stack runs SRS with the HTTP API listening at 127.0.0.1:1985 on
the local loopback interface, allowing only the SRS Stack to access it
without authentication. All other users must login and access the SRS
Stack through its interface, rather than directly accessing the SRS HTTP
API within the SRS Stack.

---------

Co-authored-by: panda <542638787@qq.com>
2023-09-08 08:22:45 +08:00
john
26b3154724
Fix dash crash if format not supported. v5.0.177 v6.0.73 (#3795)
Fix the issue of DASH crashing when audio/video formats are not
supported.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-09-07 22:56:15 +08:00
Haibo Chen
6e6b80d837
Remove unreachable issues in code (#3793)
remove unreachable links by python scripts:
```
def is_delete_issue(link):
    try:
        response = requests.get(link)
    except RequestException as e:
        print(f"An error occurred while trying to get the link: {e}")
        return False

    return "This issue has been deleted." in response.text


def remove_unreachable_links(dir):
    string_to_search = re.compile(r'// @see https://github\.com/ossrs/srs/issues/.*')
    file_list = util.find_files_with_extension(dir, ".cpp", True)
    for file in file_list:
        lines = []
        with open(file, "r", encoding="utf-8") as f:
            lines = f.readlines()
        with open(file, "w", encoding="utf-8", newline="\n") as f:    
            for line in lines:
                if string_to_search.search(line):
                    result = re.search(r'https://github\.com/ossrs/srs/issues/\d+', line)
                    if result:
                        link = result.group()
                        if is_delete_issue(link):
                            print("is_delete_issue link: file: %s, line: %s" % (file, line))
                            continue
                    
                f.write(line)

if __name__ == "__main__":
    remove_unreachable_links("srs/trunk/src/")
```
2023-09-04 16:31:54 +08:00
winlin
7138edd318 Release v6.0-d1, 6.0 dev1, v6.0.72, 167135 lines. 2023-08-31 09:49:36 +08:00
terrencetang2023
a2e10f12e2
Compile: Add aarch64 to the conditions of use of the cbrt function. v6.0.72 (#3776)
I got an error when cross-compiling the aarch64 platform, the log is as
follows:
`./libavutil/libm.h:54:32: error: static declaration of 'cbrt' follows
non-static declaration`
I see that there are such compilation errors in the
trunk/auto/depends.sh file that have been resolved for the ARM and MIPSE
platforms, and it is recommended to add the ARCH64 platform
2023-08-31 08:51:23 +08:00
Winlin
aa5ec87fcb
Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779)
## Reload Error Ignore

During a Reload, several stages will be passed through:
1. Parsing new configurations: Parse.
2. Transforming configurations: Transform.
3. Applying configurations: Apply.

Previously, any error at any stage would result in a direct exit, making
the system completely dependent on configuration checks:

```bash
./objs/srs -c conf/srs.conf -t
echo $?
#0
```

Optimized to: If an error occurs before applying the configuration, it
can be ignored. If an error occurs during the application of the
configuration, some of the configuration may have already taken effect,
leading to unpredictable behavior, so SRS will exit directly.

## Reload Fetch API

Added a new HTTP API to query the result of the reload.

```nginx
http_api {
    enabled         on;
    raw_api {
        enabled on;
        allow_reload on;
    }
}
```

```bash
curl http://localhost:1985/api/v1/raw?rpc=reload-fetch
```

```json
{
  "code": 0,
  "data": {
    "err": 0,
    "msg": "Success",
    "state": 0,
    "rid": "0s6y0n9"
  }
}

{
  "code": 0,
  "data": {
    "err": 1023,
    "msg": "code=1023(ConfigInvalid) : parse file : parse buffer containers/conf/srs.release-local.conf : root parse : parse dir : parse include buffer containers/data/config/srs.vhost.conf : read token, line=0, state=0 : line 3: unexpected end of file, expecting ; or \"}\"",
    "state": 1,
    "rid": "0g4z471"
  }
}
```

This way, you can know if the last reload of the system was successful.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-08-30 19:11:57 +08:00
Jacob Su
bb9331186b
SrsContextId assignment can be improved without create a duplicated one. v5.0.175 v6.0.70 (#3503)
SrsContextId object creation can be improved on `srs_protocol_log.cpp`,
No need to create one, then assign it back. It seems a common mistake
for Cpp programmers.

---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-08-28 15:51:23 +08:00
Winlin
cff5064d0b HLS: Fix on_hls and hls_dispose critical zone issue. v5.0.174 v6.0.69 (#3781)
on_hls and hls_dispose are two coroutines, with potential race
conditions. That is, during on_hls, if the API Server being accessed is
slower, it will switch to the hls_dispose coroutine to start cleaning
up. However, when the API Server is processing the slice, a situation
may occur where the slice does not exist, resulting in the following
log:

```
[2023-08-22 12:03:20.309][WARN][40][x5l48q7b][11] ignore task failed code=4005(HttpStatus)(Invalid HTTP status code) : callback on_hls http://localhost:2024/terraform/v1/hooks/srs/hls : http: post http://localhost:2024/terraform/v1/hooks/srs/hls with {"server_id":"vid-5d7dxn8","service_id":"cu153o7g","action":"on_hls","client_id":"x5l48q7b","ip":"172.17.0.1","vhost":"__defaultVhost__","app":"live","tcUrl":"srt://172.17.0.2/live","stream":"stream-44572-2739617660809856576","param":"secret=1ed8e0ffbc53439c8fc8da30ab8c19f0","duration":4.57,"cwd":"/usr/local/srs-stack/platform","file":"./objs/nginx/html/live/stream-44572-2739617660809856576-1.ts","url":"live/stream-44572-2739617660809856576-1.ts","m3u8":"./objs/nginx/html/live/stream-44572-2739617660809856576.m3u8","m3u8_url":"live/stream-44572-2739617660809856576.m3u8","seq_no":1,"stream_url":"/live/stream-44572-2739617660809856576","stream_id":"vid-0n9zoz3"}, status=500, res=invalid ts file ./objs/nginx/html/live/stream-44572-2739617660809856576-1.ts: stat ./objs/nginx/html/live/stream-44572-2739617660809856576-1.ts: no such file or directory
thread [40][x5l48q7b]: call() [./src/app/srs_app_hls.cpp:122][errno=11]
thread [40][x5l48q7b]: on_hls() [./src/app/srs_app_http_hooks.cpp:401][errno=11]
thread [40][x5l48q7b]: do_post() [./src/app/srs_app_http_hooks.cpp:638][errno=11]

[error] 2023/08/22 12:03:20.076984 [52][1001] Serve /terraform/v1/hooks/srs/hls failed, err is stat ./objs/nginx/html/live/stream-44572-2739617660809856576-1.ts: no such file or directory
invalid ts file ./objs/nginx/html/live/stream-44572-2739617660809856576-1.ts
main.handleOnHls.func1.1
	/g/platform/srs-hooks.go:684
main.handleOnHls.func1
	/g/platform/srs-hooks.go:720
net/http.HandlerFunc.ServeHTTP
	/usr/local/go/src/net/http/server.go:2084
net/http.(*ServeMux).ServeHTTP
	/usr/local/go/src/net/http/server.go:2462
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2916
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1966
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1571
```

Similarly, when stopping the stream, on_hls will also be called to
handle the last slice. If the API Server is slower at this time, it will
enter hls_dispose and call unpublish repeatedly. Since the previous
unpublish is still blocked in on_hls, the following interference log
will appear:

```
[2023-08-22 12:03:18.748][INFO][40][6498088c] hls cycle to dispose hls /live/stream-44572-2739617660809856576, timeout=10000000ms
[2023-08-22 12:03:18.752][WARN][40][6498088c][115] flush audio ignored, for segment is not open.
[2023-08-22 12:03:18.752][WARN][40][6498088c][115] ignore the segment close, for segment is not open.
```

Although this log will not cause problems, it can interfere with
judgment.

The solution is to add an 'unpublishing' status. If it is in the
'unpublishing' status, then do not clean up the slices.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-08-28 11:41:08 +08:00
Winlin
cf46dae80f Support include empty config file. v5.0.173 v6.0.68 (#3768)
SRS supports including another configuration in the include package.
When generating configurations, we can only generate the changed
configurations, while the unchanged configurations are in the fixed
files, for example:

```nginx
listen 1935;
include server.conf;
```

In `server.conf`, we can manage the changing configurations with the
program:

```nginx
http_api { enabled on; }
```

However, during system initialization, we often create an empty
`server.conf`, and the content is generated only after the program
starts, so `server.conf` might be an empty file. This also makes it
convenient to use a script to confirm the existence of this file:

```bash
touch server.conf
```

Currently, SRS does not support empty configurations and will report an
error. This PR is to solve this problem, making it more convenient to
use include.

`TRANS_BY_GPT4`

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-08-28 10:53:27 +08:00
Winlin
b5347e19f7 HLS: Support reload HLS asynchronously. v5.0.172 v6.0.67 (#3782)
When reloading HLS, it directly operates unpublish and publish. At this
time, if HLS is pushed, an exception may occur.

The reason is that these two coroutines operated on the HLS object at
the same time, causing a null pointer.

Solution: Use asynchronous reload. During reload, only set variables and
let the message processing coroutine implement the reload.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-08-25 09:46:21 +08:00
terrencetang2023
6babf01de2
Bugfix: Log format output type does not match. v5.0.171, v6.0.66 (#3775)
A segmentation fault occurred on arm
https://github.com/ossrs/srs/issues/3714

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-08-22 09:38:21 +08:00
Loken
fe38804e61
Incorrect use of two "int i" instances. (#3759) 2023-08-09 19:54:26 +08:00
Winlin
73dd8af4c9
HLS: Ignore empty NALU to avoid error. v6.0.65 (#3750)
For the DJI M30, there is a bug where empty NALU packets with a size of
zero are causing issues with HLS streaming. This bug leads to random
unpublish events due to the SRS disconnecting the connection for the HLS
module when it fails to handle empty NALU packets.

To address this bug, we have patched the system to ignore any empty NALU
packets with a size of zero. Additionally, we have created a tool in the
srs-bench to replay pcapng files captured by tcpdump or Wireshark. We
have also added utest using mprotect and asan to detect any memory
corruption.

It is important to note that this bug has been fixed in versions 4.0.271
6477f31004 and 5.0.170
939f6b484b. This patch specifically
addresses the issue in SRS 6.0.

Please be aware that there is another commit related to this bug that
partially fixes the issue but still leaves a small problem for asan to
detect memory corruption. This commit,
577cd299e1, only ignores empty NALU
packets but still reads beyond the memory.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-08-02 22:49:49 +08:00
Winlin
e19efe0bcd
Support helm to optimize the deployment procedure of a SRS cluster. v6.0.64 (#3611)
1. Introduce a novel Docker tag in the x.y.z format, akin to the HELM
format, such as ossrs/srs:5.0.155.
2. Incorporate the SRS_PLATFORM flag for containers initiated through
HELM.

---------

`TRANS_BY_GPT3`

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-07-27 09:07:31 +08:00
Loken
34747fa1a3
The identifier "ShowCouroutines" needs to be modified to "ShowCoroutines" in order to rectify the typographical error. v6.0.63 (#3703)
Correct the word errors by changing "ShowCoroutines" to "ShowCoroutines".

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-07-27 08:12:39 +08:00
Mr. Li
2777351c4b
Bugfix: Eliminate the redundant declaration of the _srs_rtc_manager variable. v5.0.169 v6.0.62 (#3699)
It is advised to eliminate any instances of _srs_rtc_manager that occur
multiple times.

---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-07-26 20:14:30 +08:00
john
b5f50f3bf4
API: Fix HTTPS callback issue using SNI in TLS client handshake. v4.0.270, v5.0.168, v6.0.61 (#3695)
---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-07-21 11:21:06 +08:00
chundonglinlin
3fa4f66648
WebRTC: Support config the bitrate of transcoding AAC to Opus. v5.0.167, v6.0.60 (#3515)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-07-18 11:09:50 +08:00
winlin
a1c7b9f2ba Release v6.0-d0, 6.0 dev0, v6.0.59, 166739 lines. 2023-07-10 08:17:28 +08:00
chundonglinlin
cdbe50b72a Compile: Fix typo for 3rdparty. v5.0.166, v6.0.59 (#3615)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-07-10 08:16:59 +08:00
Winlin
b1d1c7abe5
WHIP: Improve WHIP deletion by token verification. v5.0.164, v6.0.58 (#3595)
------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-07-01 19:08:21 +08:00
wangzhen
fe230365ab
BugFix: Resolve the problem of srs_error_t memory leak. v5.0.163, v6.0.57 (#3605)
---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-07-01 18:46:59 +08:00
Haibo Chen
7ba59c3635
Improve the usage of "transcode" in the "full.conf" file. v5.0.162, v6.0.56 (#3596)
---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-06-30 07:15:01 +08:00
panda
30c2f50cae
Upgrade jquery from 1.10.2 to 1.12.2 (#3571)
---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-06-30 06:28:10 +08:00
Winlin
cb44e81d83
Switch to 5.0 document, because it's beta now. (#3609)
------

Co-authored-by: john <hondaxiao@tencent.com>
2023-06-30 06:01:56 +08:00
Kazuo
43dfb1bcaa
H264: Fix H.264 ISOM reserved bit value. v5.0.161, v6.0.55 (#3551)
---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-06-21 21:20:22 +08:00
Winlin
8c061fcf5d
Docker: Refine the main dockerfile. v6.0.54 (#3594)
------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-06-20 18:05:54 +08:00
Haibo Chen
be7faf6aa3
Fix Permission Issue in depend.sh for OpenSSL Compilation. v5.0.160, v6.0.53 (#3592)
---------

Co-authored-by: john <hondaxiao@tencent.com>
2023-06-20 15:31:26 +08:00
john
113a3dd85e
Fix crash when process rtcp feedback message. v5.0.159, v6.0.52 (#3591)
---------

Co-authored-by: johzzy <hellojinqiang@gmail.com>
2023-06-20 13:20:00 +08:00
Winlin
7f997b39ae
WHIP: Add OBS support, ensuring compatibility with a unique SDP. v5.0.158, v6.0.51 (#3581)
1. Ignore SDP GROUP LS.
2. Support ice in global session info.
3. Support audio codec "OPUS" or "opus".

---------

Co-authored-by: Johnny <hellojinqiang@gmail.com>
2023-06-15 12:11:31 +08:00
Winlin
0ce2983e44
TOC: Welcome to the new TOC member, ZhangJunqin. (#3579)
------

Co-authored-by: ChenGH <chengh_math@126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: LiPeng <lipeng19811218@gmail.com>
2023-06-13 10:24:40 +08:00
chundonglinlin
74079871f6 GB: Correct the range of HEVC keyframe error. v6.0.49 (#3570)
---------

Co-authored-by: Haibo Chen <495810242@qq.com>
2023-06-12 16:48:22 +08:00
panda
1d878c2daa Fix command injection in api-server for HTTP callback. v5.0.157, v6.0.48 2023-06-05 16:38:42 +08:00
Winlin
df854339ea
TEST: Upgrade pion to v3.2.9. (#3567)
------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-06-05 11:25:04 +08:00
Winlin
104cf14d68 DTLS: Use bio callback to get fragment packet. v5.0.156, v6.0.47 (#3565)
1. The MTU is effective, with the certificate being split into two DTLS records to comply with the limit.
2. The issue occurs when using BIO_get_mem_data, which retrieves all DTLS packets in a single call, even though each is smaller than the MTU.
3. An alternative callback is available for using BIO_new with BIO_s_mem.
4. Improvements to the MTU setting were made, including adding the DTLS_set_link_mtu function and removing the SSL_set_max_send_fragment function.
5. The handshake process was refined, calling SSL_do_handshake only after ICE completion, and using SSL_read to handle handshake messages.
6. The session close code was improved to enable immediate closure upon receiving an SSL CloseNotify or fatal message.

------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-06-05 10:45:14 +08:00
chundonglinlin
27f9db9762
SSL: Fix SSL_get_error get the error of other coroutine. v5.0.155, v6.0.46 (#3513)
---------

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: winlin <winlin@vip.126.com>
2023-05-29 13:00:41 +08:00
winlin
665c30af90 Release v6.0.45, a development version.
Release v5.0-b0, 5.0 beta0, v5.0.155, 162600 lines.

PICK 6e77653cdc
2023-05-14 13:14:11 +08:00
chundonglinlin
c0e931ae7a
Replace sprintf with snprintf to eliminate compile warnings. v6.0.45 (#3534)
* Replaced all occurrences of sprintf with snprintf to address deprecation warnings
* Ensured proper buffer size is passed to snprintf to prevent potential buffer overflows
* Ran tests to confirm that the changes do not introduce any new issues or regressions

---------

Co-authored-by: ChenGH <chengh_math@126.com>
2023-05-14 13:04:21 +08:00
ChenGH
0629beeb0a
asan: Fix memory leak in asan by releasing global IPs when run_directly_or_daemon fails. v5.0.154, v6.0.44 (#3541)
* asan: when run_directly_or_daemon failed, release gloabal ips

* asan: refine global system ips release code

* Update release to v5.0.154, v6.0.44

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-05-14 12:04:58 +08:00
Winlin
78f1ebfcb1
Improve README and documents with AI. v5.0.153. v6.0.43 (#3538)
* Improve README with AI and add new features

1. Update README file with AI to make it more informative and user-friendly
2. Add a detailed table of contents (TOC) with an introduction for easy navigation
3. Introduce an auto-detecting Automake feature that displays the correct installation command
4. Add support for SRT to HTTP-TS config file
5. Refine the WHIP delete location URL
6. Add support for disabling encryption for WHIP or WHEP

This pull request aims to enhance the quality of the project by introducing innovative features and making the necessary updates. These updates will help users navigate the project more efficiently while also improving the overall project's quality.

---------

Co-authored-by: ChenGH <chengh_math@126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-05-12 17:18:30 +08:00
Winlin
7cf8c48157 WHIP: Improve HTTP DELETE for notifying server unpublish event (#3539)
This PR improves the functionality of the HTTP DELETE method used by WHIP to notify the server when the client stops publishing. The URL is parsed from the location header returned by SRS, and the URL is refined with the addition of the action=delete parameter to ensure more accurate identification of the DELETE request.

Furthermore, SRS will disconnect and close the session, enabling the client to publish the stream again quickly and easily. This update eliminates the approximately 30-second waiting period previously required for republishing the stream after an unpublish event.

Overall, this update provides a more effective and efficient method for notifying the server about unpublish events and will enhance the workflow experience for users of the WHIP platform.

-------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-05-12 15:23:04 +08:00
Winlin
26aabe413d
RTMP: Support enhanced RTMP specification for HEVC. v6.0.42 (#3495)
* RTMP: Support enhanced RTMP specification for HEVC,  v6.0.42.
* Player: Upgrade mpegts.js to support it.

Enhanced RTMP specification: https://github.com/veovera/enhanced-rtmp

First, start SRS `v6.0.42+` with HTTP-TS support:

```bash
./objs/srs -c conf/http.ts.live.conf
```

Then, you can use [OBS 29.1+](https://github.com/obsproject/obs-studio/releases) to push HEVC via RTMP.
Start OBS with the following settings in the `Settings > Stream` tab:

* Server: `rtmp://localhost/live`
* Stream Key: `livestream`
* Encoder: Please select the HEVC hardware encoder.

Finally, open the player http://localhost:8080/players/srs_player.html?stream=livestream.ts

Or use VLS or ffplay to play `http://localhost:8080/live/livestream.ts`

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-04-08 09:18:10 +08:00
Winlin
dcd02fe69c
Support composited bridges for 1:N protocols converting. v6.0.41 (#3392)
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-04-01 21:34:59 +08:00
Haibo Chen
771ae0a1a6
API: Support HTTP basic authentication for API. v6.0.4, v5.0.152 (#3458)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-04-01 12:45:29 +08:00
chundonglinlin
571043ff3d
WebRTC: Error message carries the SDP when failed. v5.0.151, v6.0.39 (#3450)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-27 22:27:01 +08:00
Winlin
b34255c3d0
WebRTC: Support configure CANDIDATE by env (#3470)
In dockerfile, we can set the default RTC candidate to env:

```
ENV SRS_RTC_SERVER_CANDIDATE=\$CANDIDATE
CMD ["./objs/srs", "-e"]
```

When starts a docker container, user can setup the candidate by env:

```
docker run --rm -it --env CANDIDATE=1.2.3.4 ossrs/srs:5
```

We should parse the content of SRS_RTC_SERVER_CANDIDATE as env variable name and parse it again.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
2023-03-27 19:24:08 +08:00
yashwardhan-jyani
b574ad1a07
Remove unneccessary NULL check in srs_freep. v5.0.150, v6.0.38 (#3477)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-03-25 12:09:13 +08:00
john
d8755711c1
RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149, v6.0.37 (#3455)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-25 11:44:48 +08:00
winlin
2ac9eb84bc Fix release bug. Release v6.0.36 2023-03-23 14:02:41 +08:00
Winlin
363e0c2a6e
WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 v6.0.36 (#3427)
* WHIP: Support DELETE resource.
* Support push by Larix.
* FLV: Disable stash buffer for realtime.
* WHEP: Fix muted issue.

-------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: panda <542638787@qq.com>
2023-03-23 10:01:20 +08:00
Winlin
c001acaae9
Support WHIP and WHEP player. v5.0.147 and v6.0.35 (#3460)
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: panda <542638787@qq.com>
2023-03-21 08:49:07 +08:00
chundonglinlin
5067e220ca
HttpConn: judge nb_chunk no memory address. (#3465)
Co-authored-by: john <hondaxiao@tencent.com>
2023-03-20 12:51:02 +08:00
chundonglinlin
2708752a9b
HEVC: webrtc support hevc on safari. v6.0.34 (#3441)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-07 20:45:57 +08:00
Winlin
a7514484a2
WebRTC: Warning if no ideal profile. v6.0.33, v5.0.146 (#3446)
For WebRTC, SRS expect the h.264 codec is:

```
a=rtpmap:106 H264/90000
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
```

But sometimes, the device does not support the profile, for example only bellow:

```
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e033
a=fmtp:122 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420033
a=fmtp:121 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640033
a=fmtp:120 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0033
```

So we should warning user about the profile missmatch, because it might not work.

----------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: LiPeng <lipeng19811218@gmail.com>
2023-03-07 19:43:47 +08:00
Winlin
b31940a15a
Support configure for generic linux. v5.0.145, v6.0.32 (#3445)
If your OS is not CentOS, Ubuntu, macOS, cygwin64, run of configure will fail with:

```
Your OS Linux is not supported.
```

For other linux systems, we should support an option:

```
./configure --generic-linux=on
```

Please note that you might still fail for other issues while configuring or building.

-------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-03-07 19:10:29 +08:00
MarkCao
8fde0366fb
Kickoff publisher when stream is idle, which means no players. v6.0.31, v5.0.144 (#3105)
For some use scenario, the publisher is invited when player want to view the stream:

1. Publisher connect to system, but does not publish any stream to SRS yet.
2. Player connect to system and start to request the stream.
3. System notifies publisher to publish stream to SRS.
4. Player play the stream from SRS.

Please notice that `system` means your business system, not SRS.

This is what we called `on-demand-live-streaming`, so when the last player stop to view the stream, what happends?

1. System needs to notify publisher to stop publish.
2. Or, SRS disconnect the publisher when idle(the last player stops playing).

This PR is for the solution 2, so that the cleanup is very simple, your system does not need to notify publisher to stop publish, because SRS has already disconnected the publihser.

---------

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-03-06 09:09:27 +08:00
Winlin
dc7be76bb1
Forward add question mark to the end. v6.0.30 (#3438)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-02-25 19:13:48 +08:00
Haibo Chen
67867242fc
GB: Support HEVC for regression test and load tool for GB. (#3416)
Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-02-25 16:25:56 +08:00
chundonglinlin
733aeaa641
API: Add service_id for http_hooks, which identify the process, v6.0.28, v5.0.142 (#3424)
Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-02-25 08:42:19 +08:00
Winlin
b75668b509
Compatible with legacy RTMP URL. v5.0.142. v6.0.27 (#3429)
For compatibility, transform
  rtmp://ip/app...vhost...VHOST/stream
to typical format:
  rtmp://ip/app/stream?vhost=VHOST

This is used for some legacy devices, which does not
support standard HTTP url query string.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-23 10:10:11 +08:00
winlin
99ca66ddc8 Add new contributors. 2023-02-21 09:13:40 +08:00
wangzhen
3ce57ae6b6
HEVC: Fix nalu vec duplicate when h265 vps/sps/pps demux. v6.0.26 (#3411)
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: winlin <winlin@vip.126.com>
2023-02-16 08:45:44 +08:00
chundonglinlin
b957463e5e
SRT: fix req param leak. (#3423)
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-16 08:25:17 +08:00
Haibo Chen
4a5f479a0c
GB: Support H.265 for GB28181 (#3408)
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: stone <bluestn@163.com>
Co-authored-by: Winlin <winlin@vip.126.com>
2023-02-14 14:28:41 +08:00
winlin
4a089935cd Rename SRS_SRS_LOG_TANK to SRS_LOG_TANK. #3410
PICK 9c9f3f1247
2023-02-13 11:37:03 +08:00
winlin
b6cb5b9cd7 Release v5.0-a4, 5.0 alpha4, v5.0.141, 161897 lines.
PICK af7f5b3c55
2023-02-12 16:27:26 +08:00
john
64fa116c65
SRT: Reduce latency to 200ms of srt2rtc.conf (#3409)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-02-12 16:22:47 +08:00
chundonglinlin
5b001fe344
Config: Error when both HLS and HTTP-TS enabled. (#3400)
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-08 20:46:45 +08:00
chundonglinlin
2b0e32aace
Kernel: Fix demux SPS error for NVENC and LARIX. v6.0.22 (#3389)
Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-02-08 20:23:25 +08:00
Haibo Chen
47c2d59b31
GB: fix pointer not free (#3396)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-02-07 20:26:54 +08:00
winlin
1d11d02e4b Update the dev code for SRS 2023-01-31 16:19:28 +08:00
Winlin
d2d976275e
How to be TOC of SRS. (#3393)
1. If achieve 50+ commits, you will be a TOC.
2. CONTRIBUTING.md rules MUST be approved by Winlin and 3+ TOC.
3. Each PR MUST be approved by 2+ TOC or Developers.
4. The name of TOC will be listed at README.md forever.

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: LiPeng <lipeng19811218@gmail.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-01-31 14:00:35 +08:00
winlin
4106d7bab3 Update SECURITY policy. 2023-01-30 14:20:37 +08:00
Winlin
913dcb4406
UTest: Fix crash for stack overflow, allocate object on heap. (#3394)
* UTest: Fix crash for stack overflow, allocate object on heap.
* H265: Refine hevc vps/sps/pps id range.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-30 11:20:47 +08:00
winlin
6dd1536186 Update backer link. 2023-01-29 19:27:29 +08:00
Haibo Chen
7e83874af0
HLS: support kick-off hls client (#3371)
* HLS: support kick-off hls client
* Refine error response when reject HLS client.
* Rename SrsM3u8CtxInfo to SrsHlsVirtualConn
* Update release v5.0.139 v6.0.21

---------

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-01-29 11:40:44 +08:00
chundonglinlin
ef90da352e
H265: Support HEVC over SRT.(#465) v6.0.20 (#3366)
* H265: Refine demux vps/sps/pps interface for SRT and GB.
* H265: Support HEVC over SRT.(#465)
* UTest: add hevc vps/sps/pps utest.
* SRT: fix mpegts.js play hevc http-flv error.
* UTest: add HTTP-TS and HTTP-FLV blackbox test.
* Update release v6.0.20

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2023-01-22 13:47:24 +08:00
john
7922057467
RTC: fix rtc publisher pli cid (#3318)
* RTC: fix rtc publisher pli cid
* RTC: log bridge request keyframe
* Update release v6.0.19 v5.0.138

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-01-19 10:49:17 +08:00
panda
81566868bf
Rewrite research/api-server code by Go, remove Python. (#3382)
* support api-server golang

* Update release to v6.0.18 and v5.0.137

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
Co-authored-by: ChenGH <chengh_math@126.com>
2023-01-18 13:11:16 +08:00
john
c5ccee1edf
SRT: fix crash when srt_to_rtmp off (#3386)
* SRT: fix crash when srt_to_rtmp off
* Release v5.0.136 v6.0.17

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-18 08:52:26 +08:00
chundonglinlin
02653ce2aa
API: Support server/pid/service label for exporter and api. (#3385)
* Exporter: Support server/pid/service.(#3378)
* API: Support return server/pid/service.(#3378)
* Use 8-length service id.
* Update release v5.0.135 v6.0.16

Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-01-18 07:25:44 +08:00
chundonglinlin
39c2b9c497
H265: Support demux vps/pps info. v6.0.15 (#3379)
* H265: Support parse vps/pps info  for SRT and GB.
* H265: Update referenced doc.
* UTest: add hevc vps/sps/pps utest.
* Update release to v6.0.15

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-01-17 18:04:53 +08:00
winlin
35fd9be863 Scorecard: Pin some github actions. 2023-01-17 13:16:05 +08:00
winlin
09b302e1ab Add HEVC feature note. 2023-01-17 13:16:05 +08:00
winlin
0d75e77725 Add WebRTC and HLS statistic/callback feature note. 2023-01-17 13:16:04 +08:00
winlin
7973068576 Fix WHIP link issue. (#3170) 2023-01-17 13:16:04 +08:00
Haibo Chen
cd2a352254 GB: Fix PSM parsing indicator bug. v6.0.15 (#3383)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-17 13:15:29 +08:00
Haibo Chen
a78936f517
GB: Fix PSM parsing indicator bug (#3383)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
2023-01-17 13:01:36 +08:00
simon1tan1
dbc8e8ca87 Console: Not needed, just a number is enough for EN. (#3380)
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-01-15 09:00:43 +08:00
winlin
8ea7d8b33f Scorecard: Add OpenSSF Best Practics badge. 2023-01-11 11:55:42 +08:00
winlin
1ead71891c Scorecard: Only update for 5.0release. 2023-01-11 11:39:05 +08:00
winlin
edb4866889 Actions: Rename workflow name. 2023-01-11 11:24:41 +08:00
Winlin
498ce72af8 SRS5: Config: Support better env name for prefixed with srs (#3370)
* Actions: Fix github action warnings.

* Forward: Bind the context id of source or stream.

* Config: Support better env names.

PICK a4e7427433

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
2023-01-11 10:57:24 +08:00
Winlin
f46231cf3e
Create SECURITY.md (#3375) 2023-01-10 22:19:27 +08:00
winlin
badf33c544 Scorecard: Delcare default permissions as read only except CodeQL. 2023-01-10 22:08:35 +08:00
Winlin
d34085615b
Create scorecard.yml (#3374) 2023-01-10 21:17:13 +08:00
mapengfei53
edba2c25f1
HEVC: Support DVR HEVC stream to MP4. v6.0.14 (#3360)
* DVR: Support mp4 blackbox test based on hooks.
* HEVC: Support DASH HEVC stream
* Refine blackbox test. v6.0.14

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: winlin <winlin@vip.126.com>
2023-01-08 15:05:43 +08:00
winlin
5ee528677b SRS5: GB: Compatible with deprecated config.
PICK 920d492942
2023-01-08 13:22:39 +08:00
stone
748aa8508f SRS5: Improve file writer performance by fwrite with cache. v5.0.133 (#3308)
* SrsFileWriter leverages libc buffer to boost dvr write speed.

* Refactor SrsFileWriter to use libc file functions mockable

* Add utest and refine code.

Co-authored-by: winlin <winlin@vip.126.com>

PICK 25eb21efe8
2023-01-08 12:06:38 +08:00
Winlin
f06a2d61f7 SRS5: DVR: Support blackbox test based on hooks. v5.0.132 (#3365)
PICK e655948e96
2023-01-07 21:34:09 +08:00
winlin
3c6ade8721 SRS5: FFmpeg: Support build with FFmpeg native opus. v5.0.131 (#3140)
PICK a27ce1d50f
2023-01-06 17:46:37 +08:00
winlin
ef533853c0 SRS5: Build: Refine install tips.
PICK 372390f8d1
2023-01-06 17:45:38 +08:00
feng
eeb42f7e4a
HTTP: Add CORS Header for private network access. v6.0.13 (#3363)
Co-authored-by: winlin <winlin@vip.126.com>
2023-01-06 15:02:53 +08:00
winlin
35e01906f2 SRS5: CORS: Refine HTTP CORS headers. v5.0.130
PICK 3612473516
2023-01-05 20:45:26 +08:00
winlin
232de03c56 SRS5: Test: Add blackbox test for SRT.
PICK 62963b206f
2023-01-05 09:07:39 +08:00
john
fe086dfc31
SRT: Upgrade libsrt from 1.4.1 to 1.5.1. v6.0.12 (#3362)
Co-authored-by: winlin <winlin@vip.126.com>
2023-01-04 19:56:33 +08:00
winlin
7a56208f2f Test: Use long duration for HLS balckbox test. 2023-01-04 19:33:48 +08:00
winlin
b104826a96 SRS5: Test: Run fast and slow blackbox tests seperately.
PICK 95b534ff10
2023-01-03 23:10:58 +08:00
winlin
57d205d5a0 Test: Use the fatest preset for HEVC blackbox test. 2023-01-03 22:30:02 +08:00
winlin
81969b3dbf SRS5: Test: Add chunksize and atc blackbox test for RTMP.
PICK c31a8076bb
2023-01-03 22:14:03 +08:00
winlin
99f61cb225 Test: Add RTMP/FLV/TS blackbox test for HEVC. (#465) 2023-01-03 21:57:46 +08:00
winlin
7b27410ac9 SRS4: Security: Enable CIDR for allow/deny play/publish. (#2914)
PICK 55ca61ec9c
2023-01-03 17:19:51 +08:00
Winlin
3e5362fbff SRS5: Test: Add blackbox for MP3 audio codec. v5.0.129 (#296) (#465)
PICK e3a4ff9fa1
PICK 3b59972a90
2023-01-03 16:55:20 +08:00
Winlin
c68db59eeb
Test: Add blackbox for HEVC over HLS. (#3356) 2023-01-03 14:51:40 +08:00
winlin
2cab98aa68 SRS5: Test: Add blackbox for HLS.
PICK 30779f3b5a
2023-01-03 14:24:57 +08:00
Winlin
4c2db0073a SRS5: Test: Support blackbox test by FFmpeg. v5.0.128 (#3355)
1. Enable blackbox test for each PR and push.
2. Refine Makefile and README for srs-bench.
3. Add blackbox using FFmpeg and ffprobe.
4. Add blackbox basic test for RTMP stream.
5. Add blackbox basic test for HTTP-FLV stream.
6. Fix utest rand seed issue.

PICK 2141d220b4
2023-01-02 15:34:19 +08:00
ChenGH
e1f6661d1f SRS5: Asan: Disable asan for CentOS and use statically link if possible. v5.0.127 (#3347) (#3352)
* Asan: Disable asan for CentOS and use statically link if possible. v5.0.127 (#3347)

1. Disable asan for all CentOS by default, however user could enable it.
2. Link asan statically if possible.

* Update version to v5.0.127

Co-authored-by: winlin <winlin@vip.126.com>

PICK dd0f398296
2023-01-02 15:03:25 +08:00
chundonglinlin
fff8d9863c
H265: Support HEVC over HLS. v6.0.11 (#465) (#3354)
* H265: Support HEVC over HLS.(#465)

* HLS: Support HEVC over HLS. v6.0.11 (#465)

Co-authored-by: winlin <winlin@vip.126.com>
2023-01-02 09:04:50 +08:00
winlin
4bfc4de710 SRS5: MP3: Upgrade mpegts.js to support HTTP-TS with mp3. v5.0.126 (#296)
PICK 02a18b328c
2023-01-01 20:26:44 +08:00
Haibo Chen
57cc843000 SRS5: API: Fix duplicated on_stop callback event bug. v5.0.125 (#3349)
* fix hls bug:Duplicated on_stop callback

* improve utest

* Refine magic number.

* API: Fix duplicated on_stop callback event bug. v5.0.125

Co-authored-by: winlin <winlin@vip.126.com>

PICK 3727d0527c
2023-01-01 19:28:10 +08:00
winlin
e4e87c0403 SRS5: Live: Refine log for monotonically increase.
PICK 6caca900b3
2023-01-01 15:21:24 +08:00
winlin
7bd8682d40 SRS5: Script: Refine depends tools. v5.0.124
1. Never auto install tools now, user should do it.
2. Support --help and --version for SRS.
3. Install tools for cygwin64.

PICK e690c93bcf
2023-01-01 14:13:22 +08:00
winlin
c46ef81ff2 SRS5: Update license date to 2023. v5.0.123
PICK 72f8ed4916
2023-01-01 08:56:20 +08:00
winlin
6ad7787c14 Asan: Refine asan warning message for macOS.
PICK 7bdb7270cf
2022-12-31 21:20:51 +08:00
winlin
3f7c4a7ff4 GB28181: Enable regression test for gb28181. v5.0.122
1. Build regression test tool for gb28181.
2. Run regression test for gb28181.
3. Format go code and eliminate logs.
4. Change base docker to ubuntu20.

PICK 7750bdae10
2022-12-31 19:47:54 +08:00
winlin
bc381a0242 SRS5: Configure: Reorder the functions, nothing changed.
PICK 4b09a7d686
2022-12-31 12:39:44 +08:00
winlin
41f7951481 SRS5: Refine configure to guess OS automatically. v5.0.121
1. Guess for macOS and cygwin64.
2. Refine options for configure.

PICK 5559ac25fe
2022-12-31 12:39:37 +08:00
winlin
1e079d2860 SRS5: Update new authors.
PICK 6299dee1b6
2022-12-31 12:39:27 +08:00
winlin
4045971dea SRS5: Refine default config file for SRS. v5.0.120
1. Docker use srs.conf and env variables.
2. Show help if run SRS without any options.
3. Do not guess config file, use whatever from user.

PICK 07a9a005d5
2022-12-31 12:39:18 +08:00
winlin
39c9487a73 Support first SRS6 version. v6.0.10 2022-12-30 19:27:43 +08:00
Winlin
4bc716179b Use english template for issue. 2022-12-30 11:43:36 +08:00
winlin
e4a9ff54f9 SRS5: Asan: Only link by statically for asan.
PICK ae3b367487
2022-12-29 19:28:42 +08:00
winlin
351f7590db SRS5: Script: Discover version from code.
PICK 87a2ef100a
2022-12-28 14:34:01 +08:00
winlin
d5bf0ba2da TS: Support disable audio or video to make mpegts.js happy. v6.0.9 (#465) (#939) 2022-12-26 19:03:49 +08:00
winlin
4b6f1b0fd6 TS: Fix bug for codec detecting for HTTP-TS. v6.0.8 (#465) 2022-12-26 18:30:12 +08:00
winlin
a6c926f985 SRS5: FLV: Fix bug for header flag gussing. v5.0.119 (#939)
PICK 8a0ac8e3a1
2022-12-26 18:06:38 +08:00
winlin
bec23fc247 SRS5: Script: Fix configure help bug.
PICK 386bb41f63
2022-12-26 18:06:38 +08:00
winlin
6875876349 SRS5: MP3: Convert RTMP(MP3) to WebRTC(OPUS). v5.0.118 (#296) (#3340)
PICK 37867533cd
2022-12-26 18:06:38 +08:00
winlin
f82f265ece SRS5: MP3: Support decode mp3 by FFmpeg natively. (#296) (#3340)
PICK 1c5788c638
2022-12-26 18:06:38 +08:00
winlin
2ed9516a35 SRS5: Actions: Fix github actions bug.
PICK fe3502e6ad
2022-12-26 18:06:38 +08:00
winlin
35c89cc436 SRS5: MP3: Support dump stream information. v5.0.117 (#296) (#3339)
PICK 95defe6dad
2022-12-26 18:06:37 +08:00
winlin
2e1d99002f SRS5: Actions: Fix GitHub actions warnings.
PICK 23b7939574
2022-12-26 18:04:14 +08:00
winlin
5d48c9ce1b Refine code to allow search for conflicts. 2022-12-25 16:26:15 +08:00
winlin
ead49e747b MP3: Support play HTTP-MP3 by H5(srs-player). v6.0.7 (#296) (#3338) 2022-12-25 16:23:52 +08:00
winlin
b5aaf67c93 Merge branch v5.0.116 into develop
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
2. MP3: Add config examples for MP3. #296
3. Script: Refine GitHub actions.
2022-12-25 16:23:23 +08:00
winlin
f6e0b1c894 MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. v5.0.116 2022-12-25 15:48:48 +08:00
winlin
3ed7d88990 Script: Refine GitHub actions. 2022-12-25 12:37:57 +08:00
winlin
0a49638f54 MP3: Add config examples for MP3. #296 2022-12-25 12:10:29 +08:00
winlin
05d7400cd5 Merge branch v4.0.269 into 5.0release
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
2022-12-25 12:10:03 +08:00
Winlin
577cd299e1
MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
* MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296)

1. Refresh HLS audio codec if changed in stream.
2. Refresh TS audio codec if changed in stream.
3. Fix mp3 demux bug in SrsFormat::audio_mp3_demux.
4. Use 3(MPEG1) not 4(MPEG2) as PMT stream type, follow FFmpeg.
5. MP3: Update utest for mp3 sample parsing.
6. MP3: Ignore empty frame sample.
7. UTest: Fix utest failed, do not copy files.
2022-12-25 11:43:26 +08:00
Winlin
9c066081dd
Update issue_template.md 2022-12-25 09:52:13 +08:00
winlin
518c25aec3 Print version and signature to stdout. 2022-12-24 10:49:22 +08:00
winlin
e45563e925 Merge branch v5.0.115 into develop
1. Asan: Support parse asan symbol backtrace log. v5.0.113 (#3324)
2. GB: Refine lazy object GC. v5.0.114 (#3321)
3. Fix #3328: Docker: Avoiding duplicated copy files. v5.0.115
2022-12-24 10:27:03 +08:00
winlin
5dcd6637e3 Fix #3328: Docker: Avoiding duplicated copy files. v5.0.115 2022-12-24 10:22:42 +08:00
Winlin
6f3d6b9b65
GB: Refine lazy object GC. v5.0.114 (#3321)
* GB: Refine lazy object GC.

1. Remove gc_set_creator_wrapper, pass by resource constructor.
2. Remove SRS_LAZY_WRAPPER_GENERATOR macro, use template directly.
3. Remove interfaces ISrsGbSipConn and ISrsGbSipConnWrapper.
4. Remove ISrsGbMediaConn and ISrsGbMediaConnWrapper.

* GC: Refine wrapper constructor.

* GB: Refine lazy object GC. v5.0.114
2022-12-20 19:54:25 +08:00
ChenGH
7eaee46f1f
Asan: Support parse asan symbol backtrace log. v5.0.113 (#3324)
* asan: support parse asan symbol log

* asan: refine srs_parse_asan_backtrace_symbols error code

* asan: Refine code, extract asan log to error file.

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-18 21:14:11 +08:00
winlin
2daf637aaa Merge 5.0: FLV header and SRT bugfix. v6.0.6
1. SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112 (#3323)
2. GB28181: Fix memory overlap for small packets. v5.0.111 (#3315)
3. FLV: Support set default has_av and disable guessing. v5.0.110 (#3311)
4. FLV: Drop packet if header flag is not matched. v5.0.109 (#3306)
5. FLV: Reset has_audio or has_video if only sequence header. (#3310)
2022-12-18 11:48:09 +08:00
winlin
2f7e474853 Merge branch v5.0.112 into develop
1. SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112 (#3323)
2. GB28181: Fix memory overlap for small packets. v5.0.111 (#3315)
3. FLV: Support set default has_av and disable guessing. v5.0.110 (#3311)
4. FLV: Drop packet if header flag is not matched. v5.0.109 (#3306)
5. FLV: Reset has_audio or has_video if only sequence header. (#3310)
2022-12-18 11:44:29 +08:00
winlin
e6f40bd0c7 Release v5.0-a2, 5.0 alpha2, v5.0.112, 161233 lines. 2022-12-18 09:55:57 +08:00
john
09a96175e8
SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112 (#3323)
* SRT: fix crash when sps/pps empty. v5.0.112

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-18 09:52:20 +08:00
Winlin
56040cab42
GB28181: Fix memory overlap for small packets. v5.0.111 (#3315) 2022-12-17 15:05:10 +08:00
Winlin
a36cb57949
FLV: Support set default has_av and disable guessing. v5.0.110 (#3311)
* FLV: Support set default has_av and disable guessing. v5.0.110

1. Support config default has_audio and has_video.
2. Support disable guessing has_audio or has_video.

* FLV: Reset to false if start to guess has_av.

* FLV: Add regression test for FLV header av metadata.
2022-12-17 14:51:48 +08:00
Winlin
7bb7be4427
Update issue_template.md 2022-12-15 18:30:07 +08:00
Winlin
4551200e95
FLV: Drop packet if header flag is not matched. v5.0.109 (#3306)
1. Ignore audo or video packets if FLV header disable it.
2. Run: Add regression test config and run for IDEA.
3. Test: Refine regression test to allow no audio/video for FLV
4. Config: Whether drop packet if not match header.
2022-12-14 21:07:14 +08:00
Winlin
35185cf844
FLV: Reset has_audio or has_video if only sequence header. (#3310)
1. Reset has_audio if got some video frames but no audio frames.
2. Reset has_video if got some audio frames but no video frames.
3. Note that audio/video frames are not sequence header.
2022-12-14 21:05:13 +08:00
Winlin
c39edf4788
Player: Support nginx-http-flv-module stream url. (#3305) 2022-12-13 21:03:44 +08:00
Winlin
476a32d417
Build: Fix build warnings (#3302)
1. Avoid default guess for expression.
2. Force to void* for memset.
2022-12-13 21:03:27 +08:00
winlin
72182865ef Merge branch v5.0.108 into develop
* DASH: Fix dash crash bug when writing file. v5.0.108 (#3301)
* Test: Refine cache for cygwin64 test.
2022-12-13 00:43:37 +08:00
john
d1bc155c8b
DASH: Fix dash crash bug when writing file. v5.0.108 (#3301)
Co-authored-by: winlin <winlin@vip.126.com>
2022-12-13 00:42:46 +08:00
winlin
61d3815fdf Test: Refine cache for cygwin64 test. 2022-12-13 00:30:38 +08:00
winlin
4f8f6ca6f8 Merge v5.0.107 into develop
* SRT: Support SRT to RTMP to WebRTC. v5.0.107 (#3296)
2022-12-09 08:09:37 +08:00
winlin
56be854f36 Update README. 2022-12-09 08:04:58 +08:00
john
bbe333d3ca
SRT: Support SRT to RTMP to WebRTC. v5.0.107 (#3296)
* SRT: Support SRT to RTMP to WebRTC. v5.0.107

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-09 08:01:12 +08:00
winlin
3049fa70eb Merge branch v5.0.106 into develop
* Build: Refine cygwin64 test script.
* API: Parse fragment of URI. v5.0.106 (#3295)
2022-12-08 18:56:53 +08:00
winlin
539f5975d6 Build: Refine cygwin64 test script. 2022-12-08 16:24:27 +08:00
Haibo Chen
c5a0c5947f
API: Parse fragment of URI. v5.0.106 (#3295)
* parse fragment of uri
* adapt FMLE URL: 'rtmp://ip/app/app2#k=v/stream', then add more test case

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-08 15:48:10 +08:00
winlin
7ac1475c39 Merge #3271: H265: The codec information is incorrect. v6.0.5 2022-12-04 22:51:45 +08:00
chundonglinlin
a0803b556b
H265: Demux sps for log print and statistic streams.(#3271) (#3286)
* BitBuffer: add method to implement bit read operation.

* Codec: demux hevc sps for profile level resolution.

* Statistic: refine hevc profile level resolution.

* Kernel: return error code for demux hevc.

* Kernel: check bitstream length for hevc sps.

* UTest: add BitBuffer read bits utest.

* Kernel: refine print log and utest.

* Kernel: add comment for hevc sps.

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-04 22:46:14 +08:00
winlin
e6c395e473 Merge branch v5.0.105 into develop.
* v5.0, 2022-12-04, Cygwin: Enable gb28181 for Windows. v5.0.105
* v5.0, 2022-12-04, Asan: Set asan loging callback. v5.0.104
2022-12-04 22:39:30 +08:00
winlin
0e550d496b Cygwin: Enable gb28181 for Windows. v5.0.105 2022-12-04 22:34:36 +08:00
chengh
8be4c8e334 Asan: Set asan loging callback. v5.0.104 2022-12-04 22:24:37 +08:00
winlin
5999e446de Merge branch v5.0.103 into develop
1. GB28181: Enable GB for CentOS 7 package. v5.0.103
2. Package script support extra options. v5.0.102
3. Disable CLS and APM by default. v5.0.101
2022-12-03 21:15:22 +08:00
winlin
41769308d2 GB28181: Enable GB for CentOS 7 package. v5.0.103 2022-12-03 18:56:55 +08:00
winlin
4b5ae7b3d2 Package script support extra options. v5.0.102 2022-12-03 18:56:21 +08:00
winlin
e86e0c8999 Disable CLS and APM by default. v5.0.101 2022-12-03 18:35:41 +08:00
winlin
fa177679a6 Merge 5.0.100, v5.0-a1 into develop. 2022-12-01 23:13:56 +08:00
winlin
8adb1693cc Release v5.0-a1, 5.0 alpha1, v5.0.100, 160817 lines. 2022-12-01 23:10:21 +08:00
mapengfei53
c7b7921712
Config: Add utest for configuring with ENV variables. v5.0.100 (#3284)
* Config: Add utest for configuring with ENV variables.

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: winlin <winlin@vip.126.com>
2022-12-01 23:03:50 +08:00
stone
a4d9e45545
Live: Fix bug for gop cache limits. v5.0.99 (#3289)
* bugfix: setting srt bridge to rtmp gop cache limit while SrsMpegtsSrtConn::acquire_publish 

* setting http_stream gop cache limit while SrsHttpStreamServer::hijack

* if gop_cache_max_frames_ == 0, don't enable the got cache max frames limit

Co-authored-by: winlin <winlin@vip.126.com>
2022-12-01 22:07:11 +08:00
Winlin
e83fc2388b
Docker: Remove CentOS 6 support. (#3287)
1. Remove CentOS 6 for test and utest.
2. Statically build FFmpeg, no so depends.
2022-12-01 21:32:08 +08:00
winlin
79d096ae91 Merge branch 5.0.98 into develop
1. Release v5.0-a0, 5.0 alpha0, v5.0.98, 159813 lines.
2022-11-25 16:46:26 +08:00
winlin
aa5496aa69 Release v5.0-a0, 5.0 alpha0, v5.0.98, 159813 lines. 2022-11-25 13:41:38 +08:00
winlin
152099b734 Merge branch v5.0.98 into develop.
1. Config: Add ENV tips for config. 5.0.97
2. SRT: Support transform tlpkdrop to tlpktdrop. 5.0.98
2022-11-25 11:36:45 +08:00
Winlin
5cadfff2e5
SRT: Support transform tlpkdrop to tlpktdrop. 5.0.98 (#3279) 2022-11-25 11:28:49 +08:00
Winlin
fdbfe59784
Config: Add ENV tips for config. 5.0.97 (#3278) 2022-11-25 10:46:09 +08:00
winlin
9b7db9aa68 DASH: Update README for MPEG-DASH. 2022-11-24 18:45:52 +08:00
winlin
0dd4dae59b Merge 5.0release 2022-11-24 18:14:52 +08:00
john
d927996890 DASH: Fix number mode bug to make it run. v5.0.96 (#3240)
* Add utc time utility
* Fix calculate duration in fmp4
* Refine dash code, use segment template timeline
* Shrink m4s file and cleanup
* Support play by dash.js
* Use SegmentTemplate timeline mode with $Number$

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-24 18:13:49 +08:00
john
271afbbf82
DASH: Fix number mode bug to make it run. v5.0.96 (#3240)
* Add utc time utility
* Fix calculate duration in fmp4
* Refine dash code, use segment template timeline
* Shrink m4s file and cleanup
* Support play by dash.js
* Use SegmentTemplate timeline mode with $Number$

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-24 18:09:50 +08:00
Winlin
e6ccd8ec9a For #3176: GB28181: Error and logging for HEVC. v5.0.95 (#3276)
1. Parse video codec from PSM packet.
2. Return error and logging if HEVC packet.
3. Ignore invalid AVC NALUs, drop AVC AUD and SEI.
4. Disconnect TCP connection if HEVC.
2022-11-24 09:04:15 +08:00
Winlin
af192d6184
For #3176: GB28181: Error and logging for HEVC. v5.0.95 (#3276)
1. Parse video codec from PSM packet.
2. Return error and logging if HEVC packet.
3. Ignore invalid AVC NALUs, drop AVC AUD and SEI.
4. Disconnect TCP connection if HEVC.
2022-11-24 09:01:01 +08:00
winlin
56bf2a421f Merge 5.0release 2022-11-23 18:53:52 +08:00
winlin
237d60a55d Coverage: Refine the codecov link. 2022-11-23 18:30:47 +08:00
winlin
e17f2fc675 Config: Add hevc.ts.conf for HEVC over HTTP-TS. 2022-11-23 17:24:03 +08:00
Winlin
70d5618979
H265: Support HEVC over HTTP-TS. v6.0.4 (#3275)
1. Update TS video codec to HEVC during streaming.
2. Return error when HEVC is disabled.
3. Parse HEVC NALU type by SrsHevcNaluTypeParse.
4. Show message when codec change for TS.

Co-authored-by: runner365 <shi.weibd@hotmail.com>
2022-11-23 17:05:21 +08:00
winlin
8debbe6db8 Asan: Fix utest bug. 2022-11-23 16:51:09 +08:00
winlin
f10412d289 Asan: Fix utest bug. 2022-11-23 16:46:57 +08:00
Winlin
f316e9a0de
H265: Support parse multiple NALUs in a frame. v6.0.3 (#3274)
1. Fix parsing multiple NALUs bug.
2. Eliminate duplicated code for parsing NALU.
3. Return error when HEVC not enabled.
2022-11-23 12:13:53 +08:00
winlin
02d47c5c21 Docs: Update features with version. 2022-11-23 11:56:37 +08:00
Winlin
96b4918c25 For #3236: Live: Change gop cache limits to 2500. v5.0.94 (#3273) 2022-11-23 09:52:27 +08:00
Winlin
13918ed81f
For #3236: Live: Change gop cache limits to 2500. v5.0.94 (#3273) 2022-11-23 09:50:19 +08:00
Winlin
178e40a5fc
H265: Support HEVC over RTMP or HTTP-FLV. (#3272)
1. Support configure with --h265=on.
2. Parse HEVC(H.265) from FLV or RTMP packet.
3. Support HEVC over RTMP or HTTP-FLV.

Co-authored-by: runner365 <shi.weibd@hotmail.com>
2022-11-23 08:34:13 +08:00
Winlin
7e02d972ea
H265: Update mpegts.js to play HEVC over HTTP-TS/FLV. v6.0.1 (#3268)
1. Update mpegts.js to support HEVC over HTTP-TS.
2. Merge https://github.com/xqq/mpegts.js/pull/68 for HEVC over HTTP-FLV.
2022-11-22 22:23:14 +08:00
Winlin
4b3fe68973
Init SRS 6. v6.0.0 (#3269) 2022-11-22 22:20:19 +08:00
winlin
0b955b4166 Update README for SRS 6.0 2022-11-22 12:49:19 +08:00
winlin
d2a526ae6a Develop is SRS 6.0 now.
This reverts commit daa7fd2247.
2022-11-22 12:44:49 +08:00
winlin
daa7fd2247 Create 5.0release branch, features freezed. 2022-11-22 12:41:57 +08:00
stone
ec76512e42
Live: Limit cached max frames by gop_cache_max_frames (#3236)
* add gop_cache_max_frames

* Live: Limit cached max frames by gop_cache_max_frames. v5.0.93

Co-authored-by: wanglei <wanglei@unicloud.com>
Co-authored-by: winlin <winlin@vip.126.com>
2022-11-22 12:31:45 +08:00
winlin
4ada0bc629 Asan: Cleanup for testing for asan. 2022-11-22 12:26:05 +08:00
winlin
cdbebb3729 Merge branch '4.0release' into develop 2022-11-22 11:25:06 +08:00
winlin
2573a25101 Release v4.0-r4, 4.0 release4, v4.0.268, 145482 lines. 2022-11-22 11:01:56 +08:00
johzzy
e529536563 WebRTC: Fix no audio and video issue for Firefox. (#3079) v4.0.268
* Remove extern SrsPps* duplicate declarations

* fix(rtmp2rtc): fix video payload type for rtmp to rtc bridge (#3041)

* Revert changes not belongs to this PR.

* Fix naming issue, follow SRS style.

* Use srs_assert instead of assert.

* Fix firefox no audio issue.

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-22 10:58:48 +08:00
Winlin
b72ad85502
Asan: Check libasan and show tips. v5.0.92 (#3266) 2022-11-22 10:40:18 +08:00
Winlin
136e5cf0e0
Support gitee mirror for release resource files. (#3265) 2022-11-22 10:06:16 +08:00
ChenGH
6b130d4205
Asan: Try to fix st_memory_leak for asan check (#3264)
* asan: try to fix st_memory_leak for asan check

* asan: srs_st_unit should be call in hybrid server stop

* Rename st_uninit to st_destroy. v5.0.91

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-21 23:49:38 +08:00
chengh
6fa17aa3f8 ST: Support st_destroy to free resources for asan. 2022-11-21 22:26:46 +08:00
johzzy
6eb10afca2
WebRTC: Fix no audio and video issue for Firefox. (#3079)
* Remove extern SrsPps* duplicate declarations

* fix(rtmp2rtc): fix video payload type for rtmp to rtc bridge (#3041)

* Revert changes not belongs to this PR.

* Fix naming issue, follow SRS style.

* Use srs_assert instead of assert.

* Fix firefox no audio issue.

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-21 22:01:01 +08:00
mingo-wu
62ab1a1c69 Fix the recursively included issue for srs_core_time.hpp (#3159)
* Update srs_core_time.hpp

In included file: main file cannot be included recursively when building a preambleclang(pp_including_mainfile_in_preamble)
srs_core.hpp(43, 10): Error occurred here

* Update srs_core_time.hpp

Reference to trunk/src/protocol/srs_protocol_http_stack.hpp
  (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__)
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
2022-11-21 20:33:55 +08:00
ChenGH
f4f9c70d79
Asan: Fix global ip address leak check bug. v5.0.90 (#3248)
* asan: fix global ips memory leak bug

* Asan: Fix global ip address leak check. v5.0.90

* Asan: Directly start SRS for daemon error fixed.

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-21 20:22:13 +08:00
Winlin
9191217e27
Player: Use xqq/mpegts.js to play HTTP-TS/HTTP-FLV (#3263)
1. Replace flv.js with mpegts.js
2. Use mpegts.js to play HTTP-FLV.
3. Use mpegts.js to play HTTP-TS.
2022-11-21 19:16:44 +08:00
Winlin
59d37abc2b
Player: Use H5 native to play mp4. (#3262) 2022-11-21 19:00:33 +08:00
Winlin
057b1392c0
Windows: Refine cygwin pipeline (#3260)
1. When cleanup, remove srs.exe
2. Refine NSIS command.
2022-11-21 14:32:26 +08:00
dev-clavis
fe9e7abd84
SRT: Config file does not enable srt for srt2rtc.conf (#3250)
* adding enable stm

* SRT: Enable rtmp to rtc.

Co-authored-by: winlin <winlin@vip.126.com>
2022-11-21 13:35:29 +08:00
winlin
a2bddbe9c3 Release: Refine pipeline for release. 2022-11-20 20:35:24 +08:00
winlin
05209eb522 Fix bug for regression test, check process by script. 2022-11-20 20:07:21 +08:00
winlin
b9284b6cc6 Windows: Support cygwin cache for test. (#3259) 2022-11-20 19:58:21 +08:00
Winlin
b18ee398ed
Windows: Support cygwin pipline and packager. v5.0.89 (#3257)
1. Support github actions on Windows Server 2022.
2. Use cygwin64 in windows-latest to build SRS.
3. Package SRS-xxx-setup.exe by NSIS.exe
4. Patch crypto/include/config.h for libsrtp.
5. Support run as administrator.
6. Apply utest for cygwin.
7. Enable srtp over openssl.
2022-11-20 15:02:08 +08:00
Winlin
d741f81110
For #2532: Windows: Support CYGWIN64 for SRS (#3255)
1. Support cygwin by '--cygwin64=on'
2. Detect cygwin automatically.
3. Disalbe sanitizer, srt and srtp with openssl.
4. Disable multiple threads, use single threads.
5. Support utest for cygwin64.
6. Query features for windows by API.
7. Disable stat APIs for cygwin.
8. Use ST select event driver.

Co-authored-by: wenjie.zhao <740936897@qq.com>
2022-11-20 12:29:57 +08:00
winlin
3d0dcb2a17 Windows: Support run in single thread mode. 2022-11-19 12:11:03 +08:00
winlin
efea38c51a Update features for SRS 5.0 2022-11-18 23:46:52 +08:00
Winlin
88641b535c UTest: Enable sanitizer for utest. (#3247)
1. Enable sanitizer for utest.
2. Allow auto detect jobs for make.
3. Show more information about build cache.
2022-11-18 23:07:49 +08:00
winlin
5bae930621 Fix #3215: Callback: Fix bug for response string 0. v5.0.88 2022-11-18 23:02:59 +08:00
wenjie.zhao
e9503a9c9a For #2532: Windows: Replace ln by cp for windows. v5.0.87 (#3246)
1. Replase ln by cp for windows.
2. Refine OS and CPU arch detecting.
3. Support configure from any directory by `SRS_WORKDIR`.
4. Support output to any directory by `SRS_OUTPUT`.
5. Disable sanitizer for gperf.
6. Use parallels build for make.
7. Refine bash variable check.
2022-11-18 23:02:38 +08:00
Winlin
368356c223
Support address sanitizer for utest and fix some leaks. (#3242)
* MP4: Fix memory leak when error.

* Kernel: Support free global objects for utest.

* HTTP: Fix memory leak when error.

* MP4: Support more sample rate for audio.

* RTMP: Support free field for utest.

* UTest: Support address sanitizer.
2022-11-18 11:19:01 +08:00
Winlin
be0241efdb
Delete SECURITY.md 2022-11-03 19:43:01 +08:00
Winlin
58b00b0cf9
Delete CODE_OF_CONDUCT.md 2022-11-03 19:42:46 +08:00
chundonglinlin
9f4338bd9d
For #2899: Exporter: Add metrics cpu, memory and uname. (#3224)
* Exporter: metrics support cpu gauge.
* Exporter: metrics support memory and uname..
* Exporter: Ignore error when uname fail.

Co-authored-by: winlin <winlin@vip.126.com>
2022-10-31 08:53:58 +08:00
winlin
9673bfb92c Config: Support set env_only by SRS_ENV_ONLY. 2022-10-30 21:01:02 +08:00
winlin
9f7a06bc9e Config: Support startting with environment variable only. v5.0.85 2022-10-30 15:18:59 +08:00
winlin
ef0aefd546 GC: Eliminate unused code. v5.0.84 2022-10-30 12:42:37 +08:00
john
7d9dc69ae1
SRT: Support encrypt, with utest (#3223)
* SRT: support encrypt, with utest

* SRT: refine set srt option error log
2022-10-28 16:55:35 +08:00
winlin
8dcbcd1656 GB28181: Update README for GB28181. 2022-10-26 21:30:40 +08:00
Winlin
2d1ba46e37
Fix #3218: Log: Follow Java/log4j log level specs. v5.0.83 (#3219)
1. Support Java/log4j log level text.
2. Support configuring by `--log-new-level=on` which is enabled by default.
3. Support `--log-new-level=off` to use SRS 4.0 log level for compatibility.
2022-10-26 21:23:03 +08:00
john
20c38e07c0
SRT: Print socket status string when error (#3217) 2022-10-25 21:11:25 +08:00
winlin
b8461ba236 Refine print constant string. 2022-10-25 13:39:49 +08:00
winlin
e9915c3bd7 Log: Refine the log interface. v5.0.82 2022-10-25 09:20:55 +08:00
winlin
252851d1b0 For #3216: Support Google Address Sanitizer. v5.0.81 2022-10-23 19:42:17 +08:00
winlin
764e9a6751 For #3216: Support force daemon for sanitizer. 2022-10-23 08:06:44 +08:00
ChenGH
961f701929
Sanitizer: Support address sanitizer for x86_64 platform (#3212)
* Sanitizer: Support address sanitizer for x86_64 platform
* Sanitizer: Not mac os need -static-libasan
* Sanitizer: Add script for docker test.
* Sanitizer: Refine build script.
* Santizer: Fix ossrs/srs:dev-gcc7-cache cannot find libasan bug
* Sanitizer: Support sanitizer when use ossrs/srs:dev-cache and ubuntuxx-cache
* Sanitizer: Add sanitizer-static config

Co-authored-by: winlin <winlin@vip.126.com>
2022-10-23 07:21:15 +08:00
winlin
e10fa6dc91 Kernel: Support grab backtrace stack when assert fail. v5.0.80 2022-10-21 23:37:30 +08:00
winlin
5a1a234855 ST: Refine tools and CMakeLists.txt. Add backtrace example. v5.0.79 2022-10-21 22:42:58 +08:00
winlin
d9cf874033 Build: Refine build script. 2022-10-12 20:21:23 +08:00
winlin
21b9345387 Fix #2901: Edge: Fast disconnect and reconnect. v5.0.78 2022-10-10 08:24:26 +08:00
winlin
7d782ee8c9 Fix #2901: Edge: Fast disconnect and reconnect. v4.0.267 2022-10-10 08:14:48 +08:00
winlin
7ddabd2cc2 Config: Remove space of directive. 2022-10-10 07:40:22 +08:00
winlin
5b3dd61deb GB28181: Fix sip.candidate configuration bug. v5.0.77 2022-10-09 22:37:06 +08:00
mapengfei53
dd563d45ca
Config: Support overwrote by environment variables. (#3200)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
2022-10-09 21:11:33 +08:00
john
f1be2ebd3b
SRT: use default streamid when empty (#3202)
* SRT: use default streamid when empty

* Fix #3198: SRT: Support PUSH SRT by IP and optional port. v5.0.76

Co-authored-by: winlin <winlin@vip.126.com>
2022-10-09 08:28:28 +08:00
winlin
c12deded98 GB28181: Fix bug for parsing GB to RTC. 2022-10-07 19:47:34 +08:00
Winlin
5a420ece3b
GB28181: Support GB28181-2016 protocol. v5.0.74 (#3201)
01. Support GB config as StreamCaster.
02. Support disable GB by --gb28181=off.
03. Add utests for SIP examples.
04. Wireshark plugin to decode TCP/9000 as rtp.rfc4571
05. Support MPEGPS program stream codec.
06. Add utest for PS stream codec.
07. Decode MPEGPS packet stream.
08. Carry RTP and PS packet as helper in PS message.
09. Support recover from error mode.
10. Support process by a pack of PS/TS messages.
11. Add statistic for recovered and msgs dropped.
12. Recover from err position fastly.
13. Define state machine for GB session.
14. Bind context to GB session.
15. Re-invite when media disconnected.
16. Update GitHub actions with GB28181.
17. Support parse CANDIDATE by env or pip.
18. Support mux GB28181 to RTMP.
19. Support regression test by srs-bench.
2022-10-06 17:40:58 +08:00
winlin
9c81a0e1bd UTest: Fix utest warnings. 2022-10-06 16:09:07 +08:00
winlin
cfbbe3044f HTTP: Skip body and left message by upgrade. v5.0.73 2022-10-05 20:49:50 +08:00
winlin
d4ce877407 Kernel: Refine lazy sweep resource. 2022-10-04 21:07:49 +08:00
mapengfei53
eb04f92176
Config: Support overwrote by environment variables. (#3197)
* Support overwrite by environment virable.

* modify duplicated code

* Config: Add stat for envrionment config.

* Config: Fix utest fail.

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: winlin <winlin@vip.126.com>
2022-10-03 13:00:12 +08:00
winlin
dc20d5ddbc ST: Support set context id while thread running. v5.0.72 2022-10-02 10:05:01 +08:00
chundonglinlin
9525511032
Exporter: Listen at port 9972 for Prometheus exporter. (#3195) 2022-10-01 07:35:54 +08:00
winlin
4ad4dd0975 RTC: Refine SDP to support GB28181 SSRC spec. v5.0.71 2022-09-30 19:36:20 +08:00
winlin
d32bd72527 Micro changes and fix utest fail. 2022-09-30 19:32:22 +08:00
winlin
1e6143e2eb GB28181: Refine HTTP parser to support SIP. v5.0.70 2022-09-30 19:21:31 +08:00
winlin
dae46a59ae Fix utest failed. 2022-09-30 19:15:02 +08:00
winlin
927dd473eb Kernel: Support lazy sweeping simple GC. v5.0.69 2022-09-30 18:33:29 +08:00
winlin
4b7d9587f4 HTTP: Support HTTP header in creating order. v5.0.68 2022-09-30 18:22:25 +08:00
winlin
d65c699829 Micro changes and refines. 2022-09-30 18:11:59 +08:00
winlin
378bffa34f Micro changes and refines. 2022-09-30 17:57:48 +08:00
winlin
173c683566 GB28181: Refine SRS listeners without wrapper. 2022-09-30 12:38:02 +08:00
winlin
b452144fb7 GB28181: Remove unused RTSP protocol stack. 2022-09-30 12:35:10 +08:00
winlin
912cd6a59c Merge branch '4.0release' into develop 2022-09-28 17:47:51 +08:00
winlin
8bd8c1146d WebRTC: Eliminate unused debugging log. 2022-09-28 17:46:50 +08:00
winlin
5f8da02ee7 API: Refine stat and config for prometheus exporter. 2022-09-28 16:07:26 +08:00
chundonglinlin
981cab40d3
API: support metrics for prometheus.(#2899) (#3189)
* API: support metrics for prometheus.

* Metrics: optimize metrics statistics info.

* Refine: remove redundant code.

* Refine: fix metrics srs_streams param.

* Metrics: add major param.

* Metrics: refine params and metric comments.

* For #2899: API: Support exporter for Prometheus. v5.0.67

Co-authored-by: winlin <winlin@vip.126.com>
2022-09-27 15:39:26 +08:00
winlin
e31f3b0e64 For #3167: WebRTC: Refine sequence jitter algorithm. v5.0.66 2022-09-27 14:54:22 +08:00
winlin
0c6d30861b Merge branch '4.0release' into develop 2022-09-27 14:53:23 +08:00
winlin
386b92e9ab For #3167: WebRTC: Refine sequence jitter algorithm. v4.0.266 2022-09-27 14:53:05 +08:00
winlin
ccd9eee2c9 For #3187: Fix build warning for unused variable. 2022-09-27 08:56:53 +08:00
john
62cd2fba85
SRT: do not ignore AUD nalus (#3187) 2022-09-26 22:05:13 +08:00
john
b328142140
Printf warn log when SRT audio duration too large (#3186)
* SRT: print warning log when audio duration too large

* Fix #3164: SRT: Choppy when audio ts gap is too large. v5.0.65

Co-authored-by: winlin <winlin@vip.126.com>
2022-09-22 20:37:22 +08:00
hondaxiao
4acb246c57 Fix #3181: SRT & WebRTC: Use SrsRawH264Stream to mux SPS/PPS. 2022-09-22 14:55:55 +08:00
winlin
f974c7c8b0 Fix #3183: Fix build fail for HDS. 2022-09-21 20:07:48 +08:00
winlin
d4898bec3c APM: Check endpoint port and team. 2022-09-21 20:06:33 +08:00
winlin
6f7b242ce2 APM: Extract research to projects. 2022-09-19 13:30:22 +08:00
winlin
b95734fb09 STAT: Update statistic for RISCV. 2022-09-19 10:55:50 +08:00
winlin
e63c02e928 APM: Update statistic for APM. 2022-09-16 21:04:43 +08:00
winlin
3e2f8622f8 APM: Support distributed tracing by Tencent Cloud APM. v5.0.63 2022-09-16 18:54:28 +08:00
winlin
736c661808 Merge 4.0 release 2022-09-16 18:37:07 +08:00
winlin
0e68dc2939 Refine 4.0 release workflow. 2022-09-16 13:15:23 +08:00
winlin
762b314700 Refine release workflow. 2022-09-16 13:11:20 +08:00
winlin
f02656f946 Merge branch '4.0release' into develop 2022-09-16 10:14:12 +08:00
winlin
64c2ac8176 Release v4.0-r3, 4.0 release3, v4.0.265, 145328 lines. 2022-09-16 10:10:35 +08:00
winlin
4d0a4faa9d For #3179: WebRTC: Make sure the same m-lines order for offer and answer. v5.0.63 2022-09-16 08:09:30 +08:00
winlin
1b25ef9028 Merge branch '4.0release' into develop 2022-09-16 08:05:32 +08:00
winlin
686f57799e Fix #3179: WebRTC: Make sure the same m-lines order for offer and answer. v4.0.265 2022-09-16 08:02:12 +08:00
winlin
b2ad3bcdc8 WebRTC: Print offer if negotiate failed. 2022-09-11 21:57:59 +08:00
winlin
98ba8ae541 For #3174: WebRTC: Support Unity to publish or play stream. v5.0.62 2022-09-10 21:27:33 +08:00
winlin
6d18093e16 Merge branch '4.0release' into develop 2022-09-10 21:25:38 +08:00
winlin
aea2bfbaf9 For #3174: WebRTC: Support Unity to publish or play stream. v4.0.264 2022-09-09 16:34:45 +08:00
winlin
8ac8ae1c2e Fix #3093: WebRTC: Error when SDP not matched. 2022-09-09 16:19:47 +08:00
winlin
1c0236aa0d Fix #3093: WebRTC: Ignore unknown fmtp for h.264. v4.0.263 2022-09-09 16:17:01 +08:00
faicker
ef3347e37e
WebRTC: Fix missing type in track desc when backup H.264 payload type is chosen.
Signed-off-by: faicker <faicker.mo@gmail.com>

Signed-off-by: faicker <faicker.mo@gmail.com>
2022-09-09 14:27:24 +08:00
winlin
3eb046612b Fix #3170: WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v5.0.61 2022-09-06 18:48:46 +08:00
winlin
e47c3c410c Merge branch '4.0release' into develop 2022-09-06 18:47:22 +08:00
winlin
15610ca488 Fix #3170: WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v4.0.262 2022-09-06 18:46:47 +08:00
winlin
297a104fef Update state-threads to v1.9.4. 2022-09-06 09:22:32 +08:00
winlin
0410915ddd Update features for SRS 5.0 2022-09-06 09:04:44 +08:00
winlin
2144ff8c40 For #2852: WebRTC: Support only one TCP connected candidate. 2022-09-05 08:51:24 +08:00
Li Peng
efa0851476 WebRTC: Refine code and destroy session when tcp close. 2022-09-04 22:57:47 +08:00
Li Peng
07339e1417 WebRTC: Support TCP network. 2022-09-04 20:46:39 +08:00
winlin
625069af7f WebRTC: Extract SrsRtcNetwork layer for UDP/TCP. 2022-09-04 20:14:09 +08:00
winlin
770d959148 WebRTC: Support config, listener and SDP for TCP transport. 2022-09-04 20:13:33 +08:00
winlin
424713a31d Merge branch '4.0release' into develop 2022-09-03 22:12:46 +08:00
winlin
e0c8c199d5 Fix HTTP url parsing bug. v4.0.261 2022-09-03 22:11:00 +08:00
winlin
79358673ef Merge branch '4.0release' into develop 2022-09-03 18:13:11 +08:00
winlin
34196ea7f7 Fix #3167: WebRTC: Play stucked when republish. v4.0.260 2022-09-03 17:14:32 +08:00
winlin
38c3d9f1a7 Config: Refine config file, nothing changed. 2022-09-02 22:21:52 +08:00
winlin
77e1f81f91 For #1405: Fix utest build failed, for parsing SPS/PPS. 2022-09-02 11:37:05 +08:00
winlin
84c96076a9 Merge branch '4.0release' into develop 2022-09-02 10:57:56 +08:00
winlin
4a225c5640 For #307: WebRTC: Support use domain name as CANDIDATE. v4.0.259 2022-09-02 10:52:30 +08:00
winlin
6988e60ad6 Fix #1405: Restore the stream when parsing failed. v5.0.59 2022-09-01 21:45:19 +08:00
chundonglinlin
ef04d411c0 Main: remove extra space and refine code. (#3127) 2022-09-01 19:45:09 +08:00
mingo-wu
232fbfa4c3
Update srs_core_performance.hpp (#3160)
In included file: main file cannot be included recursively when building a preamble
    clang(pp_including_mainfile_in_preamble)
    srs_core.hpp(43, 10): Error occurred here
2022-09-01 19:39:34 +08:00
winlin
783aea7ac3 Fix #1405: Support guessing IBMF first. v5.0.58 2022-09-01 19:28:51 +08:00
winlin
e027d28c4d HLS: Support disable hls_ts_ctx. 2022-09-01 16:17:47 +08:00
winlin
eb2056db25 ST: Define and use a new jmpbuf. v5.0.57 2022-09-01 11:51:04 +08:00
winlin
7d47017a00 Ingest: Still use -re for stream to ingest HLS better. 2022-08-31 13:30:13 +08:00
winlin
dd37a041b9 Fix URL parsing bug for __defaultVhost__. v5.0.55 2022-08-31 11:46:09 +08:00
winlin
b009860b11 UTest: Split utest to smaller file. 2022-08-31 09:18:47 +08:00
winlin
6a108fab6d Fix #2837: Callback: Support stream_url and stream_id. v5.0.55 2022-08-31 08:00:05 +08:00
winlin
9c6774b644 STAT: Refine tcUrl for SRT/RTC. v5.0.54 2022-08-30 21:28:06 +08:00
winlin
d877c0b76f Tools: Update console and httpx. 2022-08-30 19:25:42 +08:00
winlin
2c259bd95b Refactor: Extract SrsNetworkKbps from SrsKbps. v5.0.53 2022-08-30 13:41:27 +08:00
winlin
937605b18c Remove bandwidth check because falsh is disabled. v5.0.52 2022-08-30 10:45:40 +08:00
winlin
1630918b0f Refactor: Use compositor for ISrsKbpsDelta. v5.0.51 2022-08-30 09:26:51 +08:00
winlin
29ae29c693 Merge branch '4.0release' into develop 2022-08-29 19:24:17 +08:00
winlin
88ba3d25f8 Copy libxml2-dev for FFmpeg. v4.0.258 2022-08-29 19:23:02 +08:00
winlin
db91102e67 STAT: Extract an ephemeral delta object. 2022-08-29 13:44:10 +08:00
winlin
4fe90d4885 RTC: Stat the WebRTC clients bandwidth. v5.0.50 2022-08-29 13:21:43 +08:00
winlin
d7c2d5ab01 HLS: Stat the HLS streaming clients bandwidth. v5.0.49 2022-08-29 12:09:26 +08:00
winlin
c1df280211 HLS: Rebuild m3u8 to make ts with id, for stat. 2022-08-29 09:08:46 +08:00
winlin
bc569d91a0 STAT: Ignore stat for API, only for HTTP streaming clients. 2022-08-29 07:54:48 +08:00
winlin
28154e820c URL: Use SrsHttpUri to parse URL and query. 2022-08-28 20:24:07 +08:00
winlin
9bd3c51818 RTMP: Refine code for gussing stream by app. 2022-08-28 17:03:34 +08:00
chundonglinlin
96add9be3d RTMP: Support publish with Server without StreamKey using OBS.(#3018) 2022-08-28 16:19:11 +08:00
winlin
f492d8b03a HTTP: Support API with body, for RTC. 2022-08-28 16:14:05 +08:00
winlin
457738f6eb Fix #2881: HTTP: Support merging api to server. v5.0.47 2022-08-28 13:11:31 +08:00
winlin
6508a082e9 Fix #3108: STAT: Update stat for SRT. v5.0.46 2022-08-27 20:40:34 +08:00
winlin
4e3ea99ccd STAT: Refine stat for global server. 2022-08-27 20:40:34 +08:00
winlin
da24de5ecb STAT: Update stat for SRT connection. 2022-08-27 20:40:34 +08:00
winlin
101e4fa3b9 STAT: Add hls-play, flv-play, srt-play and srt-publish. 2022-08-27 20:40:33 +08:00
winlin
2944fe430f STAT: Only stat media streaming clients. 2022-08-27 20:39:09 +08:00
winlin
ccf83a3f68 HLS: Extract a HLS streaming to serve pseudo session. 2022-08-27 20:37:27 +08:00
winlin
d39995cc31 HLS: Enable hls_ctx by default. 2022-08-27 19:41:07 +08:00
ChenHaibo
ca7b5a1c4e HLS: Add utest for HLS streaming. 2022-08-27 19:41:07 +08:00
ChenHaibo
2c569f568c HLS: Support config hls_ctx to disable HLS streaming. 2022-08-27 19:41:07 +08:00
winlin
6dc86b8a2e CLS: Refine logging to global object. 2022-08-27 18:56:53 +08:00
winlin
8bc7342c3c Protobuf: Extract protobuf encoder. 2022-08-26 18:46:26 +08:00
winlin
a54d371549 Log: Stat the number of logs. v5.0.45 2022-08-26 12:41:19 +08:00
winlin
5757950860 Merge 4.0release 2022-08-26 11:42:29 +08:00
winlin
cdccdf70b8 Hooks: Remove on_connect and on_close from doc. 2022-08-26 10:39:00 +08:00
winlin
5225a07727 Merge 4.0release 2022-08-25 07:31:53 +08:00
winlin
d5293e34e1 Refine release doc and wiki link. 2022-08-25 07:27:00 +08:00
winlin
18d25eacfb Merge 4.0release 2022-08-24 19:26:47 +08:00
winlin
fe2002794f Release v4.0-r2, 4.0 release2, v4.0.257, 144890 lines. 2022-08-24 18:25:30 +08:00
winlin
95cd0e84eb Log: Support write log to tencentcloud CLS. v5.0.44 2022-08-24 15:51:23 +08:00
winlin
3da0b57121 Merge 4.0release. 2022-08-24 15:27:56 +08:00
winlin
9923c749d4 STAT: Support config server_id and generate one if empty. v4.0.257 2022-08-24 15:06:43 +08:00
winlin
8e6d207e56 For #2136: API: Cleanup no active streams for statistics. v4.0.256 2022-08-24 12:47:16 +08:00
winlin
41155b7789 STAT: Add kbps for client. 2022-08-24 12:42:21 +08:00
winlin
2438bc99e0 Config: Refine ulimit check. 2022-08-22 19:46:47 +08:00
winlin
9b010ac158 Fix #3114: Origin cluster config bug. v5.0.43 2022-08-22 11:43:44 +08:00
winlin
e9d6601f7d For #2136: API: Cleanup no active streams for statistics. v5.0.42 2022-08-19 19:45:19 +08:00
winlin
4edf33326d Merge branch '4.0release' into develop 2022-08-17 11:10:30 +08:00
winlin
f9941a325b RTMP URL supports domain in stream parameters. v4.0.255 2022-08-17 11:08:32 +08:00
winlin
f911e3861b Refine README badges. 2022-08-15 08:18:20 +08:00
winlin
8898ba9769 Remove lighthouse and droplet docker image. 2022-08-15 07:58:59 +08:00
winlin
4126c42118 Speedup test by refine the task dependencies. 2022-08-15 07:57:42 +08:00
winlin
2d036c3fd6 Fix #2747: Support Apple Silicon M1(aarch64). v5.0.41 2022-08-14 22:46:54 +08:00
ChenGH
f2fa289fe8 AppleM1: Support Apple Silicon M1(aarch64). 2022-08-14 22:46:52 +08:00
winlin
b787656eea AppleM1: Update openssl to v1.1.1l 2022-08-14 22:46:51 +08:00
winlin
1fe12b8e8c Speedup test by using cache image. 2022-08-14 22:41:29 +08:00
winlin
d4e5138a58 Speedup test actions. 2022-08-13 08:39:44 +08:00
winlin
d478d7b2ca Add test for crossbuild on Ubuntu20. 2022-08-12 20:12:13 +08:00
winlin
a842c6c32a Support crossbuild for hisiv500. v5.0.40 2022-08-12 17:41:15 +08:00
winlin
d885d574e4 Add files for reuse port for origins. 2022-08-12 17:40:57 +08:00
winlin
93b773cb22 Show alternative LICENSE MulanPSL-2.0 2022-08-11 22:14:24 +08:00
winlin
b73847de7d Refine configure for crossbuild. 2022-08-11 16:55:24 +08:00
winlin
7f7406ec77 Build: Detect OS by packager. v5.0.39 2022-08-10 23:20:14 +08:00
winlin
0227e44ef0 Fix warning for comparing int with sizeof. 2022-08-10 19:34:23 +08:00
winlin
26284e368f Merge branch '4.0release' into develop 2022-08-10 10:23:25 +08:00
winlin
febd45d514 Fix server id generator bug. v4.0.254 2022-08-10 10:20:47 +08:00
winlin
262b79f747 Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.38 2022-08-10 08:35:39 +08:00
winlin
a71eddd56a Fix the snprintf size issue. 2022-08-10 08:32:02 +08:00
winlin
1ab584b2ae Loongson/mips64: Support FFmpeg and openssl. 2022-08-09 22:44:10 +08:00
winlin
0a025fc4b6 Remove unneccessary depends headers. 2022-08-09 18:32:01 +08:00
winlin
50be42a8ed Fix README link issue. 2022-08-09 16:01:54 +08:00
winlin
25c004e947 Opus: Add TODO because the audio might be corrupted, if use FFmpeg native opus. 2022-08-09 13:35:57 +08:00
winlin
46cb4ced93 GitHub: Refine actions yaml. 2022-08-09 08:27:13 +08:00
winlin
f9e8065b51 Fix build warnings. 2022-08-09 08:27:08 +08:00
winlin
f44b694a17 For test docker image, use cache eventhough the kernel changed. v5.0.37 2022-08-09 08:27:01 +08:00
winlin
14832b66eb Build: Disable openssl ASM for loongson. v5.0.35 2022-08-08 20:33:27 +08:00
winlin
5ae495ab95 For #1229: Check the return value of vsnprintf. 2022-08-08 08:31:57 +08:00
winlin
079ac107f0 For loongarch, fix openssl build bug, always use linux64-mips64 as required. 2022-08-06 17:26:55 +08:00
winlin
1589858cb0 Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.34 2022-08-06 13:03:45 +08:00
winlin
aba6667357 Refine build script. 2022-08-05 18:32:05 +08:00
winlin
2e4fe0aea9 Refine options, extract crossbuild from toolchain. 2022-08-05 18:24:46 +08:00
winlin
f7280399d4 Merge 4.0release, migrate to new website. 2022-07-31 18:34:18 +08:00
winlin
7b23a42139 Migrate license to new website. 2022-07-31 17:12:14 +08:00
winlin
d57e9c758e Docs: Migrate to ossrs.net and ossrs.io 2022-07-31 16:26:35 +08:00
winlin
6c295952f6 RTMP: Fix unused variable warning. 2022-07-20 21:53:57 +08:00
Steven Liu
08c4b25030 RISCV: Patch ST and libsrtp. #3115 2022-07-20 21:53:39 +08:00
Steven Liu
8a6fa30992 app/srs_app_rtmp_conn: move err result to RTC MACRO to fix compiling warning 2022-07-18 13:50:10 +08:00
Steven Liu
ad2d7c3779 srtp-2-fit/config.guess: add riscv support 2022-07-18 13:46:59 +08:00
Steven Liu
ec7123d54c Support riscv, starfive CPU.
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2022-07-16 16:52:24 +08:00
winlin
588d6d510e UTEST: Refine coverage script. 2022-07-02 14:21:12 +08:00
winlin
755a2a74ed Merge branch '4.0release' into develop 2022-07-02 14:18:49 +08:00
winlin
7d0d2af817 UTEST: Refine coverage script. 2022-07-02 14:04:26 +08:00
winlin
db5d6dcd4a Support thread pool and update ossrs.net. v5.0.33 2022-06-30 07:46:29 +08:00
winlin
cd85a96255 Update SRS image for r.ossrs.net 2022-06-30 07:43:13 +08:00
winlin
0badae4797 Support thread pool and update ossrs.net. v5.0.33 2022-06-29 20:48:08 +08:00
winlin
57be5188c3 Merge branch '4.0release' into develop 2022-06-29 20:37:20 +08:00
winlin
a2cfec2dcc Update SRS image for r.ossrs.net 2022-06-29 20:36:35 +08:00
winlin
b2e083b00d Support multiple threads by thread pool. v5.0.32 2022-06-29 20:15:44 +08:00
winlin
7c6bd0ce5c Refine async DVR manager. 2022-06-29 19:51:10 +08:00
winlin
b4774d02cc Add log to file config. 2022-06-29 19:50:57 +08:00
winlin
e05535267b Disable reload for log config. 2022-06-29 19:29:50 +08:00
winlin
cb6a4d0143 Thread: Refine SrsThreadMutex and SrsThreadLocker. 2022-06-28 20:50:25 +08:00
winlin
339d3b31cc ST: Support thread-local for multiple threads.
1. All statick and global variables is thread-local.
2. Call st_init() to init st for each thread.
3. Notice that ST is isolate for threads.
2022-06-28 20:49:53 +08:00
winlin
d117145b95 Update date from 2021 to 2022. 2022-06-20 19:22:25 +08:00
winlin
06e8680545 Refine licence as main LICENSE and DUAL. 2022-06-17 17:39:42 +08:00
winlin
f92fb9653b Speedup the test from srs-cache image. 2022-06-17 14:18:27 +08:00
winlin
c722eba48f SRT: Support Coroutine Native SRT over ST. (#3010). (1af30de). v5.0.30 2022-06-17 08:54:00 +08:00
winlin
82efa564e4 Merge branch '4.0release' into develop 2022-06-17 07:13:37 +08:00
winlin
d9352ec43b Disable all asm for FFmpeg, to compatible with ARM CPU. 2022-06-15 21:13:56 +08:00
winlin
f568e4f91d Docker: Support x86_64, armv7 and aarch64 docker image (#3058). v5.0.29 2022-06-15 19:35:24 +08:00
winlin
d525d27e64 Merge from 4.0release 2022-06-15 19:21:13 +08:00
winlin
1f0ea3fdf5 Docker: Support x86_64, armv7 and aarch64 docker image (#3058). v4.0.252 2022-06-15 09:58:05 +08:00
winlin
1af30dea32 SRT: Support Coroutine Native SRT over ST. #3010 2022-06-14 20:21:47 +08:00
winlin
93fed3874b SRT: Rebase develop. 2022-06-14 20:17:00 +08:00
winlin
0957cdb944 SRT: Refine the lock for log. 2022-06-14 20:05:11 +08:00
hondaxiao
910b5945af SRT: add srt log handle, srs log supoort multithread 2022-06-14 20:05:11 +08:00
hondaxiao
d03c6793b8 SRT: add srs_core_lock, support scope lock guard 2022-06-14 20:05:11 +08:00
hondaxiao
fd74b2f6e1 SRT: readd mix_correct, compatible old srt conf 2022-06-14 20:05:11 +08:00
hondaxiao
c037f920b2 SRT: move accept log into srt conn cycle 2022-06-14 20:05:11 +08:00
winlin
e09daa2d4b SRT: Change bridges to bridge. 2022-06-14 20:05:09 +08:00
winlin
077d93c7b6 SRT: Refine code, remove SrsSrtListenerType 2022-06-14 20:02:25 +08:00
winlin
9efb6de0b4 SRT: Merge develop, fix build fail. 2022-06-14 20:02:25 +08:00
winlin
d2149a8b79 SRT: Add todo for coroutine yield. 2022-06-14 20:02:25 +08:00
winlin
8437370c1e SRT: Refine packet error handler. 2022-06-14 20:02:25 +08:00
winlin
9a0db5a14f SRT: Undo extract of fetch_or_create_source and change mode_ to local. 2022-06-14 20:02:25 +08:00
winlin
6009395c10 SRT: Hide srt implements from API. 2022-06-14 20:02:25 +08:00
winlin
d39ec3cf45 SRT: Extract ISrsSrtPoller to hide SRT_EPOLL_EVENT 2022-06-14 20:02:25 +08:00
winlin
94cc50d146 SRT: Wrap SRT stat object. 2022-06-14 20:02:25 +08:00
winlin
78b778fb93 SRT: Rename srs_service_st_srt to srs_protocol_srt 2022-06-14 20:02:25 +08:00
hondaxiao
fbc6eebe18 SRT: remove rtmp_to_srt 2022-06-14 20:02:25 +08:00
hondaxiao
43d98d0b1c SRT: remove mix_correct 2022-06-14 20:02:24 +08:00
hondaxiao
a5ac7cfe37 SRT: use srs code style in function defination 2022-06-14 20:02:24 +08:00
hondaxiao
59d9cdbe61 SRT: add option peer_idle_timeout in full.conf 2022-06-14 20:02:24 +08:00
hondaxiao
dd8ccfe5d8 SRT: refine int to srs_utime_t in srt timeout config 2022-06-14 20:02:24 +08:00
hondaxiao
26498a00fe SRT: Tsbpdmode default on 2022-06-14 20:02:24 +08:00
hondaxiao
a929f79d2c SRT: Add SRT option annotation in full.conf 2022-06-14 20:02:24 +08:00
winlin
492e3a888c SRT: Refine the SRT socket code. 2022-06-14 20:02:24 +08:00
winlin
6c94e91792 SRT: Refine get_srt_poller to poller. 2022-06-14 20:02:24 +08:00
winlin
21899c5998 SRT: Initialize SRT eventloop in adapter. 2022-06-14 20:02:24 +08:00
winlin
4899be9c34 SRT: Refine the schedule resolution to 10ms if idle. 2022-06-14 20:02:24 +08:00
winlin
b507a080b2 SRT: Refine parse SRT listen ip and port. 2022-06-14 20:02:24 +08:00
winlin
3616c9976a SRT: Add srt vhost section to full.conf. 2022-06-14 20:02:24 +08:00
winlin
ef553b571c SRT: Update full.conf for review. 2022-06-14 20:02:24 +08:00
winlin
bda0268a37 SRT: Update full.conf for new configs. 2022-06-14 20:02:24 +08:00
winlin
d88fd12c26 SRT: Fix cmake bug, quit if error. 2022-06-14 20:02:24 +08:00
hondaxiao
b566182f0b SRT: fix utest failed 2022-06-14 20:02:24 +08:00
hondaxiao
e13d16439e SRT: support rtmp to srt 2022-06-14 20:02:22 +08:00
hondaxiao
7da792f19d SRT: check srt_connect return value 2022-06-14 19:59:13 +08:00
winlin
bb91297071 SRT: Eliminate unused files for SRT. 2022-06-14 19:59:12 +08:00
winlin
cf4fbb887b SRT: Support debugging with CLion. 2022-06-14 19:58:46 +08:00
hondaxiao
94fa0ff7bd Refine SRT code, with StateThread adpater 2022-06-14 19:58:42 +08:00
winlin
3ed4aed824 Fix build failed. 2022-06-09 20:46:20 +08:00
winlin
fa78cf3354 Prefix with srs_protocol in protocol directory. 2022-06-09 20:26:58 +08:00
winlin
665ad564fb Rename service to protocol files. 2022-06-09 19:59:51 +08:00
winlin
f1840b87e5 Fix typo, change bridger to bridge. 2022-06-09 19:35:07 +08:00
winlin
0304e78cf1 Support SIGABRT to generate coredump. 2022-05-25 12:45:58 +08:00
winlin
f469753b07 RTMP: Add conf for listen at IPv6. 2022-05-17 21:37:59 +08:00
winlin
310514ea94 Update players and console. 2022-05-16 22:44:21 +08:00
winlin
e2cc356c31 Update 3rdparty. 2022-05-16 22:37:22 +08:00
winlin
ec5bdc7dfa Refine the signaling dynamic images. 2022-05-16 22:24:27 +08:00
winlin
2633f03954 SRS: YouTube channel online. 2022-05-13 13:25:38 +08:00
winlin
7e0beb11d8 Conf: Refine comments. 2022-05-10 22:17:55 +08:00
winlin
c574ab6465 Live: Refine edge cluster to support FLV. 2022-05-10 22:16:32 +08:00
winlin
5e12fceaba Update issue template. 2022-04-29 18:22:33 +08:00
winlin
23eb99c5f8 Update issue template. 2022-04-29 17:55:02 +08:00
winlin
e8240d64be HTTP: Add configure for nginx proxy. 2022-04-24 09:24:04 +08:00
winlin
2b2379de12 RTC: Refine player sdk, reject with xhr. 2022-04-10 16:39:56 +08:00
winlin
b3baa888ee RTC: Refine player sdk, directly use raw HTTP. 2022-04-08 23:02:32 +08:00
Winlin
1a6d94abcd
Update SECURITY.md 2022-04-07 13:56:53 +08:00
Winlin
ebed253db7
Create SECURITY.md 2022-04-07 13:54:39 +08:00
winlin
16babd2b64 Merge branch '4.0release' into develop 2022-04-07 13:48:59 +08:00
winlin
1d503c770f Fix proc stat issue. 2022-04-07 13:48:19 +08:00
winlin
e14c3a946d Update README. 2022-04-06 17:15:34 +08:00
winlin
1e2f8dc299 Update README for single node architecture. 2022-04-06 17:01:22 +08:00
winlin
2d50fb0882 Update LICENSE. 2022-04-06 13:03:32 +08:00
winlin
3bc17488bc Update SRS 4.0 single node arch. 2022-04-05 11:11:25 +08:00
winlin
d38b8fcf1d Update SRS 4.0 single node arch. 2022-04-05 11:00:06 +08:00
winlin
5470c177b5 Merge branch '4.0release' into develop 2022-04-04 16:49:53 +08:00
winlin
f87a959480 Support NGINX HLS Cluster. 2022-04-04 16:49:15 +08:00
winlin
4163dce18d Support NGINX HLS Cluster. v5.0.28 2022-04-04 13:45:49 +08:00
winlin
101d1ffbbf Support DigitalOcean Droplet SRS 1-Click. v5.0.27 2022-03-30 12:39:56 +08:00
winlin
1463192763 Refine README. 2022-03-23 10:36:58 +08:00
mapengfei53
8dc5853f8c
Fix parse_file function did not handle err (#2928)
* Fix parse file function did not handle err

* Fix parse_file function did not handle err

* Fix error message

* Updated error information
2022-03-19 13:22:27 +08:00
winlin
9385f2b80b Merge branch '4.0release' into develop 2022-03-19 13:21:58 +08:00
winlin
dbfa761aed Release v4.0-b10, 4.0 beta10, v4.0.251, 144665 lines. 2022-03-19 13:04:06 +08:00
winlin
76ed0200b4 SRT: Decouple publish with play url (#2893). v4.0.251 2022-03-19 12:06:07 +08:00
winlin
41e35155f7 SRT: Compatible with previous auth querystring. #2908 2022-03-19 09:04:51 +08:00
loveforever
210cdf04be
SRT: url supports multiple QueryStrings (#2908)
* SRT:  parse srt url to supports multiple QueryStrings.(#2893)

* SRT:  url supports multiple QueryStrings by  comma-separated key-value pairs with no nesting  (#2893)

* SRT:  url supports multiple QueryStrings by comma-separated key-value pairs with no nesting  (#2893)

* SRT: Add comments for url.

* Add utest for SRT URL parsing.

* Update README.

Co-authored-by: winlin <winlin@vip.126.com>
2022-03-19 08:24:06 +08:00
winlin
c225c3f745 Merge branch '4.0release' into develop 2022-03-18 12:03:52 +08:00
winlin
06cff31b24 Update script. 2022-03-18 12:02:49 +08:00
winlin
fd219aa074 Refine utest script. 2022-03-18 12:01:11 +08:00
Winlin
350c05c589
UTest: Upgrade gtest to 1.11 and support clion. (#2970) 2022-03-17 16:56:52 +08:00
winlin
90bc56b36f Update PR template. 2022-03-17 11:53:31 +08:00
winlin
c5cc79ee6f SRT: Support debug and run with CLion. v4.0.249 2022-03-17 08:42:44 +08:00
winlin
3998a88cc9 Update README for mermaid. 2022-03-15 14:25:09 +08:00
winlin
0008927d76 Update README for FOSSA. 2022-03-15 14:19:41 +08:00
winlin
b0463c2a4d Update README for FOSSA. 2022-03-15 13:51:27 +08:00
winlin
8703957595 Update README for FOSSA LICNESE scan. 2022-03-15 13:48:41 +08:00
winlin
61f1531aa3 Merge branch '4.0release' into develop 2022-03-15 08:48:26 +08:00
ChenGH
ab81696102 Bugfix: Fix rtcp nack blp encode bug (#2966). v4.0.248
Co-authored-by: Winlin <winlin@vip.126.com>
2022-03-15 08:43:03 +08:00
ChenGH
70aa6b66bb
bugfix: fix rtcp nack blp encode bug (#2966)
Co-authored-by: Winlin <winlin@vip.126.com>
2022-03-15 08:40:06 +08:00
winlin
636066124a SRT: Fix typo in libsrt build options. v5.0.26 2022-03-12 18:37:41 +08:00
everything411
d6ead6c0c5
SRT: Fix typo in libsrt build options (#2943)
the cmake option is ENABLE_APPS, so we should use --disable-apps or --enable-apps=0. this commit fixes the typo.
2022-03-12 18:34:30 +08:00
Haibo Chen
67ccd589c1
Security: Enable CIDR for allow/deny play/publish (#2914)
* protocol/utility: add srs_ipv4_to_num

* protocol/utility: add srs_ipv4_within_mask

* protocol/utility: add srs_get_cidr_mask and CIDR_VALUES static struct

* protocol/utility: add srs_get_cidr_ipv4

* app/security: support cidr ip ranges in allow/deny rules

* conf: update security example with cidr ranges

* Security: Enable CIDR for allow/deny play/publish

* Security: Enable CIDR for allow/deny play/publish

* Security: Enable CIDR for allow/deny play/publish

* fix compile error on centos6

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2022-03-11 12:24:35 +08:00
winlin
451b01011c Merge SRS 4.0 for bugfix. v5.0.25 2022-03-09 08:09:27 +08:00
winlin
9d3ae5c8ed Merge branch '4.0release' into develop 2022-03-09 08:06:56 +08:00
winlin
e26db694ca RTC: Identify the WebRTC publisher in param for hooks. v4.0.247 2022-03-07 16:34:51 +08:00
winlin
107ca2cbb8 SRT: Append vhost to stream, not app. v4.0.246 2022-03-07 15:53:55 +08:00
CommanderRoot
8a75e8a165
Replace deprecated String.prototype.substr() (#2948)
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() or substring() which work similarily but aren't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-07 08:02:27 +08:00
mapengfei53
84951cbc74
Update the demo config file for include directive (#2927)
* Update the demo config file for include directive

* update config file

* update config file
2022-03-05 17:43:20 +08:00
winlin
75cf9b3d19 Add single node architecture 2022-03-03 09:40:50 +08:00
winlin
95bbb5a0c3 Update README 2022-02-28 20:26:55 +08:00
Matthew
526cd62075
Fix FD leak when exceed max connections limit. (#2925)
* fix fd leak

when tcp connection exceed max_connection, that connection will leak because of not closing the fd

* fix leak, code refine
2022-02-26 07:50:09 +08:00
winlin
4b838659e9 Merge 4.0release, update AUTHORS 2022-02-18 12:45:22 +08:00
winlin
4b737f010f Merge branch 'merge/develop' into develop 2022-02-18 12:43:58 +08:00
winlin
e222f0da1b Add active developers 2022-02-16 13:16:18 +08:00
winlin
88c8a4f6c0 Squash: Bug fixed 2022-02-16 11:34:05 +08:00
winlin
f4966f992c Update 2022-02-16 11:22:10 +08:00
winlin
9dc4b78592 Update 2022-02-16 11:18:26 +08:00
winlin
d78a4f25a6 Forward: Support dynamic forwarding by backend api. (#2799). v5.0.24 2022-02-16 11:14:25 +08:00
chundonglinlin
03cf93fc2b
Forward: support config full rtmp url forward to other server (#2799)
* Forward: add backend config and demo server for dynamic create forwarder to other server.(#1342)

* Forward: if call forward backend failed, then return directly.

* Forward: add API description and change return value format.

* Forward: add backend conf file and wrapper function for backend service.

* Forward: add backend comment in full.conf and update forward.backend.conf.

* Forward: rename backend param and add comment tips.
2022-02-16 10:49:16 +08:00
winlin
cd0599baeb Release v4.0-b9, 4.0 beta9, v4.0.245, 144474 lines. 2022-02-15 19:34:01 +08:00
winlin
b94ae922d4 Fix warnings for uuid. v4.0.245 2022-02-15 19:07:37 +08:00
winlin
37b6b48882 SRT: Close connection if RTMP failed. (#2917). v4.0.244 2022-02-15 18:51:28 +08:00
loveforever
e8fca60ece
SRT: Close connection if RTMP failed. (#2917)
* SRT: using global variables  to pass errors (#2897)

* SRT: using global variables  to pass errors (#2897)
2022-02-15 18:49:17 +08:00
winlin
0a848430e9 Refine build script for SRT to avoid warnings. v4.0.243 2022-02-15 18:35:25 +08:00
winlin
eeb44ebbe9 Version: Ignore the mgmt version 2022-02-14 18:17:02 +08:00
winlin
9379ebbc2c Update the contribute guide 2022-02-14 15:45:53 +08:00
winlin
957e952b41 Update authors 2022-02-14 15:30:02 +08:00
winlin
b839c2ea9c Support include directive for config file. (#2878). v5.0.23 2022-02-14 15:20:48 +08:00
mapengfei53
fde44885d9
Support include directive for config file (#2878)
* Support include import configuration

* Remove support for regular rules

* Remove support for regular rules

* Fix configuration file parsing bug

* Added utest tests for include functionality

* Added utest tests for include functionality

* Modify the UTest function

* optimized code

* Config: Refine parse error with state

* Config: Reorder functions

* Config: Rename parsing type to context

* Config: Refine args for include

* Config: Add utests for include

* Config: Refine code, parsing recursively.

* Config: Change the mock from file to buffer

* Config: Mock buffer in config

* Config: Refine code

* Add utests for include

* Added utest for include

Co-authored-by: pengfei.ma <pengfei.ma@ngaa.com.cn>
Co-authored-by: winlin <winlin@vip.126.com>
2022-02-14 15:08:51 +08:00
winlin
5e78c1fe88 Update README 2022-02-14 09:41:58 +08:00
winlin
acf0af6b5a Squash: Update 2022-02-13 08:31:10 +08:00
winlin
ede1161df7 Update 2022-02-13 08:28:26 +08:00
winlin
ec89e8af86 Merge branch 'develop' into merge/develop 2022-02-13 08:27:02 +08:00
winlin
8d88a5b4cc Release v4.0-b8, 4.0 beta8, v4.0.241, 144445 lines. 2022-02-11 16:38:11 +08:00
winlin
c2b07ad943 Squash: Fix bugs 2022-02-11 08:44:31 +08:00
winlin
a35b928ccd Update 2022-02-11 08:43:15 +08:00
winlin
44de910338 Merge branch 'develop' into merge/develop 2022-02-09 11:53:32 +08:00
winlin
c9dcee778f Release v4.0-b7, 4.0 beta7, v4.0.240, 144437 lines. 2022-02-09 11:53:06 +08:00
winlin
ff93bdd14f Mirror docker images in TCR Singapore. v4.0.240 2022-02-09 11:42:02 +08:00
winlin
e27b658ef9 Refine the error for WebRTC H5 publisher. v4.0.239 2022-02-08 11:54:04 +08:00
winlin
0e9dc50d11 Support TCR docker images 2022-02-04 15:54:05 +08:00
winlin
5c1556ac74 Squash: Refine release 2022-02-04 09:57:05 +08:00
winlin
0a2c3178ad Refine 2022-02-04 09:55:41 +08:00
winlin
14648b5c2f Merge branch '4.0release' into merge/develop 2022-02-04 09:55:18 +08:00
winlin
4b50badbb8 Merge branch 'develop' into merge/develop 2022-02-04 09:55:14 +08:00
winlin
3c5a527a10 Refine label for release.yml 2022-02-04 09:25:12 +08:00
winlin
b179526de1 Release v4.0-b6, 4.0 beta6, v4.0.238, 144437 lines. 2022-02-04 09:02:05 +08:00
winlin
d1534c099b Push docker to docker, acr and tcr. v4.0.238 2022-02-04 09:01:12 +08:00
winlin
32bb96a5c2 Squash: Fix bugs 2022-02-03 15:16:52 +08:00
winlin
cc556fe921 Merge branch '4.0release' into merge/develop 2022-02-03 15:16:12 +08:00
winlin
56535cd475 Merge branch 'develop' into merge/develop 2022-02-03 15:16:08 +08:00
winlin
dcf565bba1 Fix bug when the value of http header is empty. (#2888). v4.0.237 2022-02-03 15:07:37 +08:00
Haibo Chen
290c3b95a5 Fix bug when the value of http header is empty (#2888)
* Fix bug when the value of http header is empty

* add utest
2022-02-03 15:06:06 +08:00
Haibo Chen
b94ce1485a
Fix bug when the value of http header is empty (#2888)
* Fix bug when the value of http header is empty

* add utest
2022-02-03 15:05:09 +08:00
winlin
a4a231e396 Release v4.0-b5, 4.0 beta5, v4.0.236, 144416 lines. 2022-01-30 22:37:26 +08:00
winlin
1d4fac0dbc Refine docker console, preview by players at the same server. v4.0.236 2022-01-30 22:36:01 +08:00
winlin
ba0b62fd37 For docker, always use the console for logging. v4.0.235 2022-01-30 22:01:21 +08:00
winlin
bdf6540c89 SRT: Reduce the SRT bug by limit the max times for retry. (#2896). v4.0.234 2022-01-29 15:08:56 +08:00
Alex.CR
0c036e0435
SRT: Reduce the SRT bug by limit the max times for retry. 2022-01-29 15:07:01 +08:00
winlin
6b7fc6fdb5 Squash: Fix bugs for 4.0 2022-01-23 08:12:19 +08:00
winlin
ded338ce47 Merge branch '4.0release' into merge/develop 2022-01-23 08:11:27 +08:00
winlin
03acf80dbf Merge branch 'develop' into merge/develop 2022-01-23 08:11:23 +08:00
winlin
339d942e7b Fix bug when free addrinfo. (#2886). v4.0.233 2022-01-23 08:09:37 +08:00
winlin
8f2d23ff73 Fix memory leak in SrsMetaCache. (#2887). v4.0.232 2022-01-23 08:09:20 +08:00
winlin
6c6c0f0f0f Support docker image for lighthouse. v4.0.231 2022-01-23 08:06:48 +08:00
stone
386ac44558
bugfix: SrsAutoFree addrinfo (#2886)
* bugfix: SrsAutoFree addrinfo

* bugfix: SrsAutoFreeH(addrinfo, r, freeaddrinfo)

Co-authored-by: wanglei <wanglei@unicloud.com>
2022-01-23 07:18:16 +08:00
stone
92434cfeba
bugfix:SrsMetaCache memleak (#2887)
Co-authored-by: wanglei <wanglei@unicloud.com>
2022-01-22 18:50:10 +08:00
winlin
ccc1e75f24 Update contribute guide 2022-01-19 19:04:14 +08:00
winlin
7c9f88be0b Eliminate unused *.as files for Adobe Flash. v5.0.22 2022-01-18 12:04:15 +08:00
winlin
0b87950073 Update README 2022-01-18 12:01:48 +08:00
winlin
12ffddd363 Release v5.0.21 2022-01-17 21:43:47 +08:00
winlin
bd88df9ba8 Merge branch '4.0release' into merge/develop 2022-01-17 21:43:17 +08:00
winlin
d996aea7b9 Update 2022-01-17 21:43:13 +08:00
winlin
dc43a11aed Enable rtmp2rtc and rtc2rtmp for docker.conf 2022-01-17 21:37:57 +08:00
winlin
ce5db9a040 Release v5.0.21 2022-01-17 15:06:21 +08:00
winlin
4bd4f4ad99 Merge 2022-01-17 14:41:44 +08:00
winlin
e2ea0ffadb Merge branch 'develop' into merge/develop 2022-01-17 14:30:40 +08:00
winlin
5d8b950a06 Update CHANGELOG 2022-01-17 14:30:01 +08:00
winlin
b9bfe18829 CICD: Refine release for droplet 2022-01-17 14:13:42 +08:00
winlin
27e5d77302 Squash: Update README 2022-01-17 09:47:27 +08:00
winlin
f24f214402 Merge branch '4.0release' into merge/develop 2022-01-17 09:46:25 +08:00
winlin
ddcbcbd121 Merge branch 'develop' into merge/develop 2022-01-17 09:46:21 +08:00
winlin
2502726c39 Add label **good first issue** for issues 2022-01-17 09:45:08 +08:00
winlin
16f17848bb Update README for **Cloud Virtual Machine** 2022-01-16 21:59:46 +08:00
winlin
55ea0a62d3 Build: Disable c++11 and c++14 for CentOS 6.0 2022-01-15 09:02:14 +08:00
winlin
d5c86dc5fa Switch LICENSE from MIT to **MIT or MulanPSL-2.0**. v5.0.21 2022-01-13 18:40:22 +08:00
winlin
93aa0eb5ba Squash: Fix bugs 2022-01-13 18:26:28 +08:00
winlin
5b75eadc0c Update 2022-01-13 18:25:05 +08:00
winlin
6047aaa3de Merge branch 'develop' into merge/develop 2022-01-13 18:22:02 +08:00
winlin
0dd6246c2f Release v4.0-b3, 4.0 beta3, v4.0.229, 144393 lines. 2022-01-13 18:04:21 +08:00
winlin
7796083e9a RTC: fix play rtc judge for config rtc2rtmp on. (#2872). v4.0.229 2022-01-13 17:07:10 +08:00
chundonglinlin
584889754c
RTC: fix play rtc judge for config rtc2rtmp on.(#2863) (#2872) 2022-01-13 17:03:03 +08:00
winlin
99ff853de9 Refine package variables. v4.0.228 2022-01-13 17:01:57 +08:00
winlin
8830d267f2 Refine conf for vm.conf 2022-01-13 16:20:03 +08:00
winlin
6a5bc27f9b Support configure with --config as default config file. v4.0.227 2022-01-13 15:16:54 +08:00
winlin
3881c4c77e Add SrsAutoFreeH to release ptr with hooks. (#2880). v4.0.226 2022-01-13 14:05:00 +08:00
winlin
73d0ce1cee Support api to specify the WebRTC API port. v4.0.225 2022-01-13 13:34:06 +08:00
winlin
c6c2e97189 Support api_port to specify the WebRTC API port. v4.0.225 2022-01-13 12:16:45 +08:00
winlin
db3ceb445b Support api_port to specify the WebRTC API port. v4.0.224 2022-01-13 12:07:34 +08:00
winlin
e6ab5db113 LiveSource: Refine fetch for external exposed interface. (#2873). v4.0.223 2022-01-13 11:47:14 +08:00
chundonglinlin
7580341a1e
LiveSource/RtcSource: Refine fetch for external exposed interface. (#2873) 2022-01-13 11:43:32 +08:00
winlin
71a4b3c3f7 Add conf/lighthouse.conf for LightHouse. v4.0.222 2022-01-13 11:38:25 +08:00
winlin
d47dd81f46 Refine the running homepage. v4.0.221 2022-01-13 11:10:11 +08:00
winlin
fb93631407 Refine the running homepage. v4.0.221 2022-01-13 11:00:11 +08:00
winlin
574afb4320 Refine the running homepage. v4.0.221 2022-01-13 10:44:10 +08:00
winlin
7e25d0d7f4 Refine the running homepage. v4.0.221 2022-01-12 22:03:46 +08:00
chundonglinlin
c30aa479a7
RTC: Fix both rtmp and rtc streams can be published at the same time. (#2875) 2022-01-12 09:12:29 +08:00
winlin
4110fb14cb Squash: Fix bugs. v5.0.20 2022-01-11 08:40:37 +08:00
winlin
cce6c7bf13 Update 2022-01-11 08:39:31 +08:00
winlin
7a6f77bb80 Merge branch 'develop' into merge/develop 2022-01-11 08:27:46 +08:00
winlin
e08c68b917 Update contribution 2022-01-11 08:26:21 +08:00
chundonglinlin
750c58beff
RTC: fix play rtc judge for rtmp inactive.(#2863) (#2867) 2022-01-11 08:18:06 +08:00
winlin
2bc5e9a8b4 RTC: fix play crash or no stream for rtmp2rtc tips.(#2863). v4.0.220 2022-01-10 19:16:01 +08:00
chundonglinlin
c85daeb12d
RTC: fix play crash or no stream for rtmp2rtc tips.(#2728) (#2863) 2022-01-10 19:14:11 +08:00
winlin
f178d7aae0 Update README for HTTPS Callback 2022-01-10 14:18:22 +08:00
winlin
08910e5cce Update README 2022-01-08 19:18:55 +08:00
winlin
2f6d6a0ac0 Change warn to trace for release query 2022-01-07 16:41:02 +08:00
winlin
623ca788aa Update for HTTPS server 2022-01-06 21:59:47 +08:00
liuxiaoliang
4434bb1a25
SRT: use const string to sprint rtmp url. (#2847) 2022-01-06 12:02:31 +08:00
winlin
51ca3fd80a Only discover api server ip as candidate. 2022-01-06 11:31:06 +08:00
winlin
6919011e86 Update sync script, ignore gb28181 2022-01-05 14:36:42 +08:00
winlin
0165286fab Add docker badage 2022-01-05 13:55:51 +08:00
winlin
4d09b8caae When reopening segment, never update the duration. (#2717). v4.0.219 2022-01-05 08:29:20 +08:00
winlin
fbb6d9464c Discover api server and ip as candidates. v4.0.218 2022-01-04 22:31:27 +08:00
winlin
013fa8ac6c Install test-on self-sign certificate. v4.0.217 2022-01-04 16:47:38 +08:00
winlin
c0a7790c91 Update README 2022-01-04 12:05:28 +08:00
winlin
7808bd7ca8 Support config in_docker to fix the detect fail. (#2824). v4.0.216 2022-01-03 16:55:52 +08:00
winlin
fd313133b1 Support ossrs/srs:latest as 4.0 2022-01-03 08:55:42 +08:00
winlin
a01fd52712 Release v4.0-b2, 4.0 beta2, v4.0.215, 144278 lines. 2022-01-03 08:35:23 +08:00
winlin
8bc2759c7e Refine error log for rtmp2rtc. (#2728). v4.0.215 2021-12-31 11:42:49 +08:00
Winlin
add4ff38ec
Update README.md 2021-12-31 08:27:08 +08:00
along
cf010064eb
Update srs_core.hpp (#2832)
modify a word.
2021-12-30 18:06:23 +08:00
winlin
425b5cb3ac Refresh arch image cache 2021-12-30 11:30:29 +08:00
winlin
56a9e4d140 Change images from gitee to ossrs.net 2021-12-30 11:28:10 +08:00
winlin
5aba212f3d Bugs fixed. (#2770)(#2820). v4.0.214 2021-12-29 11:57:15 +08:00
john
a9397598e8
Fix typo(HTTP-Server -> HTTPS-Server) (#2822) 2021-12-29 11:53:16 +08:00
chundonglinlin
a16590b3a6
SRT: Eliminate duplicate header file.(#2786) (#2827) 2021-12-29 11:52:02 +08:00
mapengfei53
3f8b1a2922
Fix the error of pps statistics (#2820) 2021-12-29 11:25:30 +08:00
akanchi
f1a448bc6a
SRT: Fix srt2rtmp crash when streamid is too long(#2770) (#2786) 2021-12-27 11:14:50 +08:00
winlin
c7ea21d06a Fix ulimit issue by detecting epoll on Ubuntu. (#2811). v4.0.213 2021-12-27 11:10:44 +08:00
winlin
f8122ea861 Refine ISSUE template 2021-12-27 10:19:44 +08:00
Winlin
fd90e49cd6
CI: Support build and test for CentOS 6.0 (#2816) 2021-12-26 19:12:44 +08:00
winlin
d2fe83b032 RTC: Fix build warning 2021-12-26 18:16:10 +08:00
winlin
13103ec7d5 For #2815: Extract macros and headers for platform. 2021-12-26 17:50:19 +08:00
winlin
716e578a19 Squash: Fix bugs 2021-12-26 17:30:51 +08:00
winlin
68c800c774 Update 2021-12-26 17:15:34 +08:00
winlin
4c915b66ce Merge branch 'develop' into merge/develop 2021-12-26 17:13:04 +08:00
winlin
d401c83a66 Refine install script 2021-12-26 17:11:45 +08:00
winlin
fb98113550 Fix #2815: Build fail for CentOS6 2021-12-26 17:11:26 +08:00
winlin
44e9dc83e9 Upgrade gperftools to 2.9 for GCP/GMC/GMP/GMD. (#2247) 2021-12-26 15:19:08 +08:00
winlin
63da0dca92 Cleanup server for GMC, by WaitGroup to destroy. (#2247). v4.0.206 2021-12-26 11:37:59 +08:00
winlin
73c1392748 Update 2021-12-25 18:33:12 +08:00
Winlin
6215e76bf6 Update issue templates 2021-12-25 18:18:24 +08:00
Winlin
6074540807 Update issue templates 2021-12-25 18:16:23 +08:00
winlin
1641389d1a Remove issue template 2021-12-25 18:15:44 +08:00
Winlin
25a32c0357
Create CODE_OF_CONDUCT.md 2021-12-25 18:12:11 +08:00
Winlin
5c5caca851
Create CONTRIBUTING.md 2021-12-25 18:09:53 +08:00
winlin
ab97eb5fcf HTTP: Fix 2GB+ mp4/flv file downloading error. (#2809)(#2780)(#2781). v4.0.211 2021-12-25 08:29:34 +08:00
chundonglinlin
e73d00250b
HTTP: Fix mp4/flv file size exceed 2GB download error (#2780) (#2809) 2021-12-25 08:18:47 +08:00
winlin
16d7b5d7d4 Update stackoverflow badge 2021-12-24 13:24:48 +08:00
winlin
faf5fb0a83 Refine the config 2021-12-24 10:37:58 +08:00
winlin
cc501e3eef Fix bug for large mp4(5G+) offset. (#2800). v4.0.210 2021-12-23 18:49:21 +08:00
john
aa85ce024b
DVR: Fix large file mp4 dvr failed. (#2800) 2021-12-23 18:41:05 +08:00
winlin
2f52d0aefa Fix bug for HLS log printing. (#2807). v4.0.209 2021-12-23 18:38:18 +08:00
winlin
d32195993d Refine the default config file. (#2711). v4.0.208 2021-12-23 18:34:40 +08:00
chundonglinlin
3188c772b1
RTC: Eliminate duplicate assignment for video packet frame type (#2803)
Co-authored-by: zhangjunqin1 <zhangjunqin@jd.com>
2021-12-21 08:32:17 +08:00
along
c15fadb9d5
Update the stable version to SRS 4.0 (#2802)
now 4.0 is released and stable.
VERSION_STABLE should be 4
2021-12-20 15:58:14 +08:00
winlin
ee24bb49f3 RTC: Support payload name AV1X/AV1. (#2784)(#2760). v4.0.207 2021-12-20 13:23:42 +08:00
Huachao Mao
faeacf1fc9
RTC: Replace payload name AV1X with AV1 for WebRTC. (#2760) (#2784)
* RTC: Replace payload name AV1X with AV1 for WebRTC. (#2760)

* Add compatibility check code for old versions of Chrome

* 新增获取track_desc的AV1X编码兼容性检查
2021-12-20 13:20:03 +08:00
winlin
5decc95e2e Release v4.0-b1, 4.0 beta1, v4.0.206, 144126 lines. 2021-12-19 16:49:43 +08:00
winlin
10d188faab Squash: Update README 2021-12-17 14:23:32 +08:00
winlin
d4ea11921f Merge branch '4.0release' into merge/develop 2021-12-17 14:23:02 +08:00
winlin
c5a511bc84 Update stackoverflow tag to simple-realtime-server 2021-12-17 13:56:09 +08:00
winlin
fe3b10f9aa Add stackoverflow tag 2021-12-15 16:41:36 +08:00
winlin
ab728ed5e7 Merge 2021-12-14 15:54:22 +08:00
winlin
bb6b2a849a Merge branch 'develop' into merge/develop 2021-12-14 15:52:58 +08:00
winlin
d2a6217b17 Update README for sponsors 2021-12-14 15:52:27 +08:00
winlin
b80b5a6f2a Squash: Support sponsor 2021-12-13 16:13:54 +08:00
winlin
a3e642feec Merge branch '4.0release' into merge/develop 2021-12-13 16:12:57 +08:00
winlin
b60857f4da Update 2021-12-13 16:12:54 +08:00
winlin
b0a4dfddce Support sponsor by opencollective 2021-12-13 16:09:15 +08:00
Winlin
7d50834464
Create FUNDING.yml 2021-12-13 11:04:25 +08:00
winlin
6c82d1a2d7 Update README 2021-12-13 09:35:18 +08:00
winlin
9ee1dcc385 Update README 2021-12-13 09:29:59 +08:00
winlin
f05e67e1a6 Squash: Fix bugs 2021-12-13 09:24:16 +08:00
winlin
a0aa6e7d9b Update 2021-12-13 09:23:36 +08:00
winlin
aa90358409 Merge branch 'develop' into merge/develop 2021-12-13 09:21:36 +08:00
winlin
8e4063069b Update Release 2021-12-13 08:18:42 +08:00
winlin
027715e4ea RTC: Update config 2021-12-12 15:53:08 +08:00
winlin
1a4249d74c Add discord server for SRS 2021-12-08 16:57:06 +08:00
john
7c353b5986 RTC: Fix memory leak when replace rtp packet in cache. (#2771). v4.0.205
* fix memory leak when replace rtp packet in cache.
2021-12-07 09:11:01 +08:00
winlin
3eb8fa2e31 Update README, add opencollective badge 2021-12-06 18:45:35 +08:00
winlin
37bcd9dad8 Update README, add opencollective badge 2021-12-06 18:43:01 +08:00
winlin
2f93e68285 RTC: Fix nack encode seqnum. (#2766). v4.0.204 2021-12-06 12:44:08 +08:00
long
4decc1fa6b
RTC: Fix nack encode seqnum (#2766)
* fix nack encode seqnum

* add nack encode utest

* change Variable naming

Co-authored-by: liyalong1 <liyalong1@100tal.com>
2021-12-06 12:42:39 +08:00
winlin
8576fa7052 Squash: Merge v4.0.203 2021-12-04 11:21:35 +08:00
winlin
fd59b00f6b Merge branch '4.0release' into merge/develop 2021-12-04 11:19:53 +08:00
winlin
c861774be2 Merge branch 'develop' into merge/develop 2021-12-04 11:19:49 +08:00
winlin
5ccd63dec3 RTC: Fix bugs for RTC2RTMP. (#2768). v4.0.203 2021-12-04 11:16:20 +08:00
john
f3c4023c25
Fix bugs for RTC2RTMP. (#2768)
1. Cache IDR frame's rtp timestamp instead of avsync timestamp.
2. Cache clock rate calculate by sender report.
3. Using srs_rtp_seq_distance instead of direct minus.
4. Add utest of av timestamp sync when duplicated sender report.
2021-12-04 11:15:02 +08:00
winlin
b807ef9049 Fix dead links 2021-12-04 11:08:42 +08:00
winlin
4e64c66e02 RTC: Ignore empty audio packet when transcoding (#2757). v4.0.202 2021-12-04 10:56:37 +08:00
James
2c0cd9b58d
fix #2690, 如果发现音频包为空,则不送解码,以免提前结束了解码上下文 (#2757)
* fix #2690, 如果发现音频包为空,则不送解码,以免提前结束了解码上下文

* fix #2690,出错信息中,显示相关参数名称

Co-authored-by: jiankai <wangjiankai@cmhi.chinamobile.com>
2021-12-04 10:46:17 +08:00
winlin
e16830e989 Squash: Merge 4.0.201 2021-12-04 10:43:04 +08:00
winlin
a020e8a3b7 Merge 2021-12-04 10:41:30 +08:00
winlin
874a8df003 Merge branch 'develop' into merge/develop 2021-12-04 10:38:54 +08:00
winlin
bc063945f1 Build: Change make utest for test 2021-12-02 20:15:28 +08:00
winlin
4d10a453f6 Build: Change default make to build SRS only 2021-12-01 14:07:53 +08:00
winlin
04a8a2866b Release v4.0-b0, 4.0 beta0, v4.0.201, 144022 lines. 2021-12-01 10:39:26 +08:00
winlin
1ba3de1139 Refine CHANGELOG 2021-12-01 09:17:05 +08:00
winlin
542a3e4f36 RTC: Refine publish security error message (#2762). v4.0.200 2021-12-01 08:27:13 +08:00
winlin
0c5e528e66 Refine badge for twitch.tv 2021-11-27 13:42:16 +08:00
winlin
407752c3f2 Add twitch.tv channel for SRS 2021-11-27 09:33:35 +08:00
winlin
5f79c4b4c5 Update Overview for SRS 2021-11-25 14:21:14 +08:00
winlin
7b9a3ef592 Update Overview for SRS 2021-11-25 14:18:44 +08:00
johzzy
ff8657e1c5 RTC: Fix crash when pkt->payload() if pkt is nullptr (#2751). v4.0.199 2021-11-25 07:36:12 +08:00
johzzy
a862573220
RTC: Fix crash when pkt->payload() if pkt is nullptr (#2751) 2021-11-25 07:33:41 +08:00
winlin
e2078bbd17 Add twitter, facebook and youtube badge 2021-11-22 12:41:38 +08:00
winlin
1167f68165 FLV: Add realtime HTTP-FLV config 2021-11-20 09:54:42 +08:00
winlin
76ebd8a5da Merge branch 'develop' into merge/develop 2021-11-19 10:36:46 +08:00
winlin
66435d583a Squash: Fix stat bug 2021-11-15 20:39:35 +08:00
winlin
e1caf01b41 Merge branch '4.0release' into merge/develop 2021-11-15 20:36:47 +08:00
winlin
06c2397e28 Merge branch 'develop' into merge/develop 2021-11-15 20:36:44 +08:00
winlin
f3380d2ec0 Fix bug for CPU arch info 2021-11-15 20:35:20 +08:00
winlin
365bf08280 Add mulan-incubating badge 2021-11-15 14:05:50 +08:00
winlin
2cd7000e10 Refine the docker tag with 4, v4, 4.*, v4.* 2021-11-15 11:23:23 +08:00
winlin
93242918ad Squash: For #1708 2021-11-15 11:10:44 +08:00
winlin
a277cd79c1 Merge release 2021-11-15 11:09:15 +08:00
winlin
1b1565b38a Merge branch '4.0release' into merge/develop 2021-11-15 11:07:44 +08:00
winlin
e8b48d00fe Merge branch 'develop' into merge/develop 2021-11-15 11:07:41 +08:00
winlin
93359a81cd Release 4.0 dev8, v4.0.198 2021-11-15 11:05:07 +08:00
winlin
1b44238a61 Refine release description 2021-11-15 11:01:19 +08:00
winlin
5e22b1929a ST: Print log when multiple thread stop one coroutine. (#1708). v4.0.198 2021-11-15 10:34:38 +08:00
winlin
93964bb037 ST: Print log when multiple thread stop one coroutine. (#1708) 2021-11-15 09:35:23 +08:00
winlin
ff33940d90 WebRTC: Fail to publish RTC automatically for HTML5. 2021-11-14 21:59:37 +08:00
winlin
440f29b758 Squash: Merge #2732 2021-11-14 21:50:58 +08:00
winlin
196df0bbb9 Merge branch '4.0release' into merge/develop 2021-11-14 21:49:53 +08:00
winlin
49e13fb50c Merge branch 'develop' into merge/develop 2021-11-14 21:49:48 +08:00
winlin
7771fbe858 Fix #2732: WebRTC: Fail to publish RTC automatically for HTML5. 2021-11-14 13:48:48 +08:00
winlin
5f85d405e7 Squash: Merge #2721, #2729 2021-11-13 19:36:43 +08:00
winlin
7ce3f02751 Merge branch '4.0release' into merge/develop 2021-11-13 19:34:30 +08:00
winlin
be0f6197d0 RTC: check audio track exist when negotiate (#2729) v4.0.196 2021-11-13 19:32:56 +08:00
winlin
ae13e784b4 Merge 2021-11-13 19:31:42 +08:00
winlin
d78465619b Merge branch 'develop' into merge/develop 2021-11-13 19:11:33 +08:00
john
469bd8cfe2
RTC: check audio track exist when negotiate (#2729) 2021-11-13 19:09:45 +08:00
winlin
5c09dec224 Update README, Add FAQ 2021-11-10 09:58:53 +08:00
winlin
92f061ee7d Rtc2Rtmp: Use RTP timestamp to identify video frames. v4.0.195 (#2721) 2021-11-09 07:36:48 +08:00
john
878833bb95
Rtc2Rtmp: Using rtp timestamp to distinguish different video frame (#2721) 2021-11-09 07:35:00 +08:00
winlin
6cde9a0230 Squash: Guess config files by FHS 2021-11-07 18:53:21 +08:00
winlin
4cf4e8f06b Merge branch '4.0release' into merge/develop 2021-11-07 18:49:23 +08:00
winlin
66baadb389 Merge branch 'develop' into merge/develop 2021-11-07 18:49:19 +08:00
winlin
1f4dad024e Config: Guess config files by FHS. v4.0.194 (#2711) 2021-11-07 17:39:58 +08:00
Haibo Chen
b06661539c DVR: Copy req from publish. v4.0.193 (#2714)
* DVR: copy req from publish

* DVR: copy req from publish
2021-11-07 17:01:45 +08:00
Haibo Chen
3974b319d1
DVR: Copy req from publish (#2714)
* DVR: copy req from publish

* DVR: copy req from publish
2021-11-07 16:59:33 +08:00
winlin
84a16774b2 Fix build fail for CentOS6, without SO_REUSEPORT 2021-11-05 18:32:06 +08:00
winlin
496a56fa47 Update Issue template 2021-11-05 08:02:20 +08:00
winlin
2c6ad53053 Update Issue template 2021-11-05 07:55:16 +08:00
winlin
df7faa1603 For #2369, #1708, #1941: Add utest to cover fail for close or stop 2021-11-04 08:47:40 +08:00
winlin
f4e87b17a3 AUTHORS: Update new contributors. 2021-11-04 07:38:19 +08:00
winlin
523b055c06 Squash: Support RPM. Fix bugs. 2021-11-04 07:37:17 +08:00
winlin
91228d04cc Merge branch '4.0release' into merge/develop 2021-11-04 07:36:29 +08:00
winlin
60d474b1da Merge branch 'develop' into merge/develop 2021-11-04 07:36:24 +08:00
Haibo Chen
27083430ce Edge: Refuse edge request when state is stopping (#2707) 2021-11-04 07:30:30 +08:00
Haibo Chen
a01354a595
Edge: Refuse edge request when state is stopping (#2707) 2021-11-04 07:28:48 +08:00
Purple Grape
948a3c84eb
RPM: Use user no-body to start SRS (#2706)
1、修正启动身份问题
2、其它改进
2021-11-04 07:26:37 +08:00
winlin
0d8b2df797 AUTHORS: Refine TOC of authors. 2021-11-03 13:22:27 +08:00
john
2d6ec03c5b
RTC: Remove no need code when check sdp. (#2702) 2021-11-03 07:45:37 +08:00
winlin
3df92bf30f RPM: Add RTC for rpm for CentOS/RHEL (#2701) 2021-11-03 07:40:56 +08:00
Purple Grape
75909c82d0
Package rpm support for CentOS/RHEL (#2701)
* rpm support

提供全套rpm打包方案,降低软件使用的入门难度:
1、FHS路径标准化
2、全新的init/systemd启动脚本,同时支持el6和el7
3、普通用户身份运行
4、开箱即用的默认配置文件
5、自动日志轮转

* Create srs.spec
2021-11-03 07:36:54 +08:00
winlin
6e2500a569 Release SRS v4.0.191, 4.0 dev7, bug fixed 2021-11-02 07:59:13 +08:00
winlin
551865bb73 Auto create package by github actions. v4.0.191 2021-11-02 07:56:32 +08:00
winlin
eb20458d23 Auto create package by github actions. v4.0.191 2021-11-02 07:34:45 +08:00
winlin
ab5079909d For #2369, #1708, #1941: Check errno when close fd or stop thread 2021-10-31 19:33:27 +08:00
winlin
fd7589a286 Merge 2021-10-30 12:26:15 +08:00
winlin
85eef32267 Merge branch 'develop' into merge/develop 2021-10-30 12:25:26 +08:00
qingfuliao
60ab81a5c7 IDE: Fix build problem caused by ffmpeg/pthread dependency. (#2579) 2021-10-30 12:13:37 +08:00
马文武
54b706d36e Script: Refine CentOS7 service script to restart SRS. v4.0.190 (#2552) 2021-10-30 12:09:22 +08:00
Abrar Ahmed
b9288668a7 SRT: Type from shoulde to should. (#2455)
Change word typo from shoulde to should
2021-10-30 11:42:24 +08:00
HungMingWu
cc99226ed5 SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189 2021-10-30 08:40:25 +08:00
winlin
8125dd4dd1 Forward: Fast quit when cycle fail. v4.0.188 (#2284) 2021-10-30 07:59:57 +08:00
winlin
da7fac0939 Release SRS v5.0.19, develop version, not stable 2021-10-28 08:06:26 +08:00
winlin
738a9f60ff Merge branch '4.0release' into merge/develop 2021-10-28 08:05:03 +08:00
winlin
8af98bcf46 Release SRS v4.0.187, 4.0 dev7, bug fixed. 2021-10-28 08:04:03 +08:00
winlin
7c96146d21 Merge branch '4.0release' into merge/develop 2021-10-28 08:01:44 +08:00
winlin
f8ea02fd35 Merge branch 'develop' into merge/develop 2021-10-28 08:01:40 +08:00
winlin
49f288295e Release SRS v4.0.187 2021-10-28 08:00:45 +08:00
winlin
ed1c499bd3 Gop: Ignore zero timestamp when shrinking. v4.0.187 (#2186) 2021-10-28 07:52:24 +08:00
winlin
e8380cda29 Demos: Remove the unused H5 demo files. (#2469) 2021-10-27 18:40:43 +08:00
winlin
e1f65478af Sqush: Refine config for origin cluster 2021-10-27 17:34:03 +08:00
winlin
4bf8ab0f10 Merge branch '4.0release' into merge/develop 2021-10-27 17:07:58 +08:00
winlin
428a6e4ceb Merge branch 'develop' into merge/develop 2021-10-27 17:07:54 +08:00
lvndry
e176401499 Cluster: Origin server shouldn't be it's own coworker. v4.0.186 (#1963) 2021-10-27 07:46:24 +08:00
winlin
3c4b9be76b For #2689, Refine the patches for loongarch 2021-10-26 07:15:11 +08:00
Haibo Chen
ced518ea92 STAT: Add server_id into http_hooks (#2692) v4.0.185 2021-10-25 14:14:06 +08:00
Haibo Chen
88cdba6965
STAT: Add server_id into http_hooks (#2692) 2021-10-25 14:11:15 +08:00
winlin
a6c4cc9692 Squash: Merge SRS 4.0, API: Always stat client event if auth fail. 2021-10-24 20:58:34 +08:00
winlin
587ca9816a Merge 2021-10-24 20:57:42 +08:00
winlin
9d19830bd0 Merge branch 'develop' into merge/develop 2021-10-24 20:57:06 +08:00
winlin
5783c4420f For #2689: Support stat for CPU archs. 2021-10-24 18:45:47 +08:00
winlin
99904f9ec2 For #2689: Support stat for CPU archs. 2021-10-24 18:41:12 +08:00
winlin
5b44cc6a17 For #2689, Support loongarch, loongson CPU. v5.0.19 2021-10-24 18:00:54 +08:00
Haibo Chen
592d4964ef API: Always stat client event if auth fail. v4.0.183 2021-10-22 08:06:39 +08:00
Haibo Chen
a86f3905b2
Put the statistics code after http callback (#2687) 2021-10-22 08:03:49 +08:00
winlin
f0910cf9b7 Squash: For #1758: Fix bug for marshal JSON with SDP. 2021-10-21 09:03:17 +08:00
winlin
1fc31f4967 Merge branch '4.0release' into merge/develop 2021-10-21 09:02:42 +08:00
winlin
6aac93dd30 Merge branch 'develop' into merge/develop 2021-10-21 09:02:37 +08:00
winlin
31693d4b61 For #1758: Fix bug for marshal JSON with SDP. 2021-10-21 07:36:01 +08:00
winlin
665b5f48f7 Squash: JSON: Support escape special chars. (#1758) 2021-10-20 09:16:18 +08:00
winlin
2c38478d7d Merge branch '4.0release' into merge/develop 2021-10-20 09:13:09 +08:00
winlin
ce9edb9166 Merge branch 'develop' into merge/develop 2021-10-20 09:13:05 +08:00
xmedia-systems
34b968aabf JSON: Support escape special chars. (#1758) v4.0.182 2021-10-20 08:57:40 +08:00
Matheus Macabu
061d544195 RTMP: If port is explicity set to 0, use default 1935 (#1754). v4.0.181 2021-10-19 08:24:37 +08:00
Matheus Macabu
9a017f4037
RTMP: If port is explicity set to 0, use default 1935 (#1754) 2021-10-19 08:20:28 +08:00
winlin
85131dad63 Squash: Update SRS 4.0 version 2021-10-18 15:10:05 +08:00
winlin
46e1eada2d Merge branch '4.0release' into merge/develop 2021-10-18 15:09:30 +08:00
winlin
fb7ad33dd8 Merge branch 'develop' into merge/develop 2021-10-18 15:09:25 +08:00
Alex.CR
bb7cd6af3a SRT: Solve mpegts demux assert bug (#2670) v4.0.180
* solve mpegts demux bug

* remove assert

* add error log in mpegts demux

* sovle compile problem

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-10-18 15:07:33 +08:00
Alex.CR
60c8724879
SRT: Solve mpegts demux assert bug (#2670)
* solve mpegts demux bug

* remove assert

* add error log in mpegts demux

* sovle compile problem

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-10-18 15:03:47 +08:00
winlin
596dd8c523 Support daemon(fork twice) for Darwin/OSX. v5.0.18 2021-10-17 16:53:39 +08:00
Haibo Chen
7fd5e8607c DVR: support mp3 audio codec. (#2593) v5.0.17 2021-10-16 14:06:43 +08:00
winlin
e03ada39a1 Squash: SRS v4.0.179 2021-10-16 08:07:57 +08:00
winlin
37cd894042 Merge branch '4.0release' into merge/develop 2021-10-16 08:06:53 +08:00
winlin
ff50ffd3ea Merge branch 'develop' into merge/develop 2021-10-16 08:06:48 +08:00
Haibo Chen
3fc287f7de API: Fix the same 'client_id' error when asynchronous call (#2665) v4.0.179 2021-10-16 07:53:18 +08:00
Haibo Chen
974bed6b26
API: Fix the same 'client_id' error when asynchronous call (#2665) 2021-10-16 07:50:47 +08:00
winlin
f7c32b45fd Actions: Refine release message 2021-10-15 10:04:43 +08:00
winlin
9517ef123d Squash: Update SRS 4.0 version 2021-10-14 18:33:31 +08:00
winlin
5003067aa9 Merge branch '4.0release' into merge/develop 2021-10-13 19:57:03 +08:00
winlin
761820e0ec Merge branch 'develop' into merge/develop 2021-10-13 19:56:58 +08:00
Alex.CR
1649386ed5 SRT: Pes error when mpegts demux in srt. v4.0.178
* solve mpegts demux bug

* solve pes error when mpegts demux
2021-10-13 19:53:20 +08:00
Alex.CR
44f1d8ed6d
SRT: Pes error when mpegts demux in srt (#2671)
* solve mpegts demux bug

* solve pes error when mpegts demux
2021-10-13 19:51:05 +08:00
winlin
cd7e5a131e Squash: SRS 4.0, Stat the oc(origin cluster). 2021-10-13 09:03:47 +08:00
winlin
65d947f3fb Merge branch '4.0release' into merge/develop 2021-10-13 09:02:03 +08:00
winlin
eacaf61ac7 Merge branch 'develop' into merge/develop 2021-10-13 09:01:59 +08:00
winlin
18a155bf31 API: Stat the oc(origin cluster). 2021-10-13 08:13:00 +08:00
winlin
533e86eaf8 API: Stat the oc(origin cluster). 2021-10-12 21:40:46 +08:00
winlin
135bef2182 Test: Update srs-bench depends 2021-10-12 20:30:40 +08:00
winlin
e127880ec2 Squash: Merge SRS 4.0 2021-10-12 15:09:52 +08:00
winlin
6e22f7df3c Merge branch '4.0release' into merge/develop 2021-10-12 15:08:57 +08:00
winlin
772e6fd98a Merge branch 'develop' into merge/develop 2021-10-12 15:08:49 +08:00
Haibo Chen
a2003b3a85 API: Use publish param instead of play (#2550) v4.0.177 2021-10-12 14:07:16 +08:00
Haibo Chen
579b90dc1e
on_dvr: use publish param instead of play (#2550) 2021-10-12 14:04:22 +08:00
winlin
4e6a3321cd Squash: Merge SRS 4.0 2021-10-12 14:04:02 +08:00
winlin
e09acf2c67 Update 2021-10-12 14:03:27 +08:00
winlin
b1b823a9b7 Merge branch 'develop' into merge/develop 2021-10-12 14:02:48 +08:00
winlin
5d5df7923b Config: If docker.conf does not exists, try srs.conf 2021-10-12 14:02:35 +08:00
winlin
219198d0ee Release 4.0 dev6, v4.0.176, 143675 lines. 2021-10-12 09:20:46 +08:00
Haibo Chen
eb3bbf1bca For #2549: Fix duration issue for HLS on_hls. v4.0.176 2021-10-12 09:18:39 +08:00
Haibo Chen
93cd025e2a
replace the placeholder of ts url in m3u8 (#2549) 2021-10-12 09:15:21 +08:00
winlin
b874d9c9ba Squash: Merge SRS 4.0, regression test for RTMP. 2021-10-12 08:36:24 +08:00
winlin
d30145d500 Merge branch '4.0release' into merge/develop 2021-10-12 08:34:22 +08:00
winlin
d0c32d413e Merge branch 'develop' into merge/develop 2021-10-12 08:34:17 +08:00
winlin
d6064ac608 UTest: Fix utest fail for config 2021-10-11 23:28:37 +08:00
winlin
29cf13afa0 Fix #1641, HLS/RTC picture corrupt for SPS/PPS lost. v4.0.175 2021-10-11 23:16:05 +08:00
winlin
71ed6e5dc5 RTC: Refine config, aac to rtmp_to_rtc, bframe to keep_bframe. v4.0.174 2021-10-11 22:14:45 +08:00
winlin
fe9e43b6d4 RTC: Refine config for RTC 2021-10-11 16:36:05 +08:00
winlin
0b99f06eff Test: Add RTMP to RTC regression test. 2021-10-11 09:34:08 +08:00
winlin
f8b4121497 Test: Add Multiple Sequence test for RTMP 2021-10-11 08:04:12 +08:00
winlin
29b98c49cc Test: Refine RTMP regression test. 2021-10-10 18:41:14 +08:00
winlin
9c315c94fc For #1641, Support RTMP publish and play regression test. v4.0.173 2021-10-10 18:09:52 +08:00
winlin
0f9b9505a8 RTC: Change rtc.aac to discard by default. v4.0.172 2021-10-10 17:17:14 +08:00
winlin
a81aa2edc5 Squash: Merge SRS 4.0 2021-10-10 12:05:26 +08:00
winlin
f41e79e010 Merge 2021-10-10 12:04:50 +08:00
winlin
d1d068da28 Merge branch 'develop' into merge/develop 2021-10-10 12:03:47 +08:00
winlin
2fa5a0bee8 Fix #2304, Remove Push RTSP feature. v4.0.171 2021-10-10 11:50:07 +08:00
winlin
9edf63bd30 3rdparty: Sync httpx-static 2021-10-10 11:37:19 +08:00
winlin
df53c801b2 For #2653: Update config for HTTP RAW API removed. 2021-10-10 10:28:19 +08:00
winlin
cf99ebf186 Fix #2653: Remove HTTP RAW API. v4.0.170 2021-10-10 10:23:27 +08:00
winlin
19e857ada4 Remove dead link for issues 2021-10-10 09:31:06 +08:00
winlin
2ac214fdc6 For #2654: Parse width and width from SPS/PPS. v4.0.169 2021-10-08 22:18:02 +08:00
bepartofyou
286a605c63 Fix #2654: Parse width and width from SPS/PPS. Fix #471, #1335, #2539, #1316, #1421 2021-10-08 22:04:13 +08:00
winlin
55d8cb4b7b Default to log to console for docker. v4.0.168 2021-10-08 21:58:33 +08:00
winlin
4c087b9376 Refine docker images for ossrs/srs:v4 2021-10-08 21:26:46 +08:00
winlin
1acb80b9c8 Enable WebRTC for srs.conf 2021-10-08 21:22:34 +08:00
winlin
6c597facfb Squash: Merge SRS 4.0 2021-10-07 21:39:58 +08:00
winlin
f568d3caea Merge branch '4.0release' into merge/develop 2021-10-07 21:34:53 +08:00
winlin
9f3752ffba Merge branch 'develop' into merge/develop 2021-10-07 21:34:49 +08:00
winlin
4f77ddbc06 Fix bugs #2648, #2415. v4.0.167 2021-10-07 21:33:25 +08:00
winlin
5042117034 Squash: Merge SRS 4.0 2021-10-07 21:10:44 +08:00
winlin
f8360781d3 Merge branch '4.0release' into merge/develop 2021-10-07 21:07:08 +08:00
winlin
19bab40117 Merge branch 'develop' into merge/develop 2021-10-07 21:07:04 +08:00
ChenGH
7a4de9ffe7
Fix #2415, refine dtls fragment and rtp payload size (#2652) 2021-10-07 21:05:30 +08:00
ChenGH
0093a54b34
fix bandwidth kbps caculate bug (#2648) 2021-10-04 13:40:17 +08:00
winlin
a19c0fa121 OpenWRT: Try to create dir for pidfile 2021-10-03 20:51:07 +08:00
winlin
8ea9783de7 OpenWRT: Disable mprotect of ST. 5.0.16 2021-10-03 20:24:57 +08:00
winlin
edb59ba576 Update 2021-10-03 17:55:02 +08:00
winlin
ba1bb7f745 Merge branch '4.0release' into merge/develop 2021-10-03 16:53:24 +08:00
winlin
e98c4698b4 Merge branch 'develop' into merge/develop 2021-10-03 16:53:20 +08:00
winlin
9d54bcd114 Actions: Show commit and messages. 2021-10-03 16:52:46 +08:00
winlin
cae35d7a6e Actions: Show commit and messages. Fix MIPS build fail. 2021-10-03 16:45:59 +08:00
winlin
969460d115 Update 2021-10-03 14:40:18 +08:00
winlin
d74e582ccd Merge branch 'develop' into merge/develop 2021-10-03 14:39:16 +08:00
winlin
128663e37c Actions: Show commit and messages 2021-10-03 14:38:51 +08:00
winlin
b84cbf1341 Actions: Show commit and messages 2021-10-03 14:35:03 +08:00
winlin
fb25c0a6bd Merge branch 'develop' into merge/develop 2021-10-03 14:34:34 +08:00
winlin
79f2057923 Merge branch '4.0release' into merge/develop 2021-10-03 14:34:31 +08:00
winlin
73c76e96b7 Actions: Show commit and messages 2021-10-03 14:34:23 +08:00
winlin
8685c9c12c OpenWRT: Support cross-compile SRS 2021-10-03 14:17:53 +08:00
winlin
99a967c5c3 Merge branch '4.0release' into merge/develop 2021-10-03 14:16:13 +08:00
winlin
fde85271f4 Merge 2021-10-03 14:16:07 +08:00
winlin
b6d02a51b8 OpenWRT: Fix build issues 2021-10-03 14:15:23 +08:00
winlin
c48c9603c0 Actions: Create source tar lik srs-server-5.0.14.tar.gz 2021-10-03 07:49:02 +08:00
winlin
b400c3d611 Merge branch '4.0release' into merge/develop 2021-10-03 07:45:58 +08:00
winlin
84a6695684 Merge branch 'develop' into merge/develop 2021-10-03 07:45:54 +08:00
winlin
efbff98046 Actions: Create source tar lik srs-server-4.0.165.tar.gz 2021-10-03 07:40:29 +08:00
winlin
f3c67c7a09 Actions: Refine source tar file 2021-10-03 07:26:43 +08:00
winlin
4b37f650f7 Actions: Support create release with source tar automatically. v5.0.13 2021-10-03 07:12:34 +08:00
winlin
5ac0209ed2 Merge branch 'develop' into merge/develop 2021-10-02 21:37:23 +08:00
winlin
f964dc8ef2 Merge branch '4.0release' into merge/develop 2021-10-02 21:37:19 +08:00
winlin
38f0109b21 Actions: Support create release with source tar automatically. v4.0.164 2021-10-02 21:32:38 +08:00
winlin
6e8bf8c525 Actions: Auto release SRS 5.0. 2021-10-02 18:59:51 +08:00
winlin
5d2c0498ff Merge 2021-10-02 18:57:27 +08:00
winlin
78e5b6f1b0 Merge branch 'develop' into merge/develop 2021-10-02 18:57:01 +08:00
winlin
8aa9fff271 Remove removed CircleCI 2021-10-02 18:53:54 +08:00
winlin
96a33b5748 ST: Support Cygwin64 and MIPS. 5.0.13 2021-10-02 08:56:40 +08:00
winlin
1836847269 ST: Support Cygwin64 and MIPS 2021-10-02 08:54:53 +08:00
winlin
7d3ec991e1 Squash: Merge SRS 4.0 2021-09-26 17:12:55 +08:00
winlin
df4404f9a9 Merge 2021-09-26 17:12:29 +08:00
winlin
9194d28d0c Merge branch '4.0release' into merge/develop 2021-09-26 17:11:39 +08:00
winlin
ad4b648ed2 For #2545, Refine code with space lines. 2021-09-26 17:07:59 +08:00
johzzy
ee23e3abed fix some crash in rtc. (#2545) 2021-09-26 17:04:00 +08:00
johzzy
dc778020fc
fix some crash in rtc. (#2545) 2021-09-26 17:01:53 +08:00
winlin
eb7aa98790 Merge branch 'develop' into merge/develop 2021-09-25 10:30:53 +08:00
winlin
b654fbdce4 Merge branch '4.0release' into merge/develop 2021-09-25 10:30:48 +08:00
winlin
81fa762b4f Update the SRS logo 2021-09-25 10:21:24 +08:00
winlin
149ad80b5d Squash: Merge SRS 4.0 2021-09-25 10:09:25 +08:00
winlin
00bb52bddf Merge branch 'develop' into merge/develop 2021-09-25 09:04:48 +08:00
winlin
f2ff4800fe Merge branch '4.0release' into merge/develop 2021-09-25 09:04:43 +08:00
winlin
10fe04ac18 LIVE: Add conf/live.conf for RTMP/FLV/HLS 2021-09-25 09:01:15 +08:00
winlin
34cd7b2586 Squash: Merge SRS 4.0 2021-09-23 22:35:52 +08:00
winlin
66f8e38b42 Merge branch 'develop' into merge/develop 2021-09-23 22:05:39 +08:00
winlin
f7b86a5b8d Merge branch '4.0release' into merge/develop 2021-09-23 22:05:34 +08:00
winlin
79d73bafcf Refine code space 2021-09-23 22:04:14 +08:00
winlin
c8d3542979 Fix build failed. 2021-09-23 22:04:08 +08:00
winlin
f01c9638f1 Support http callback on_play/stop. 5.0.12 2021-09-23 13:38:04 +08:00
winlin
5e453f0bab Update 2021-09-23 13:36:56 +08:00
winlin
8a78dc6868 Merge branch '4.0release' into merge/develop 2021-09-23 13:36:25 +08:00
winlin
31672806aa For #2618, #2578, SRS 4.0.163 2021-09-23 13:34:45 +08:00
Haibo Chen
36b813b971 Enhance HLS: support http callback on_play/stop, support statistic (#2578)
* Enhance HLS: support http callback on_play/stop, support statistic

* make code readable

* make code readable

* rename secret
2021-09-23 13:32:15 +08:00
Haibo Chen
f901831362
Enhance HLS: support http callback on_play/stop, support statistic (#2578)
* Enhance HLS: support http callback on_play/stop, support statistic

* make code readable

* make code readable

* rename secret
2021-09-23 13:31:45 +08:00
zozobreakzou
46adcfb6c9
[rtc] *Fix Fua package bug(payload size minus one). (#2618)
* This can cause webrtc video PacketBuffer assemble corrupt when (nal size - 1) % 1300 == 0
* issues about webrtc all caused by this bug
2021-09-23 11:10:16 +08:00
winlin
6693c73a4c Update README with docker 2021-09-22 08:33:59 +08:00
winlin
40f8460929 Squash: Merge SRS 4.0 2021-09-17 14:48:22 +08:00
winlin
e171715676 Merge branch '4.0release' into merge/develop 2021-09-17 14:47:03 +08:00
winlin
e36c90cb39 Merge branch 'develop' into merge/develop 2021-09-17 14:46:59 +08:00
winlin
4456a275b6 PushFLV: Fix bug, add stat 2021-09-17 14:20:35 +08:00
winlin
5828d64a3d For #2613, #2614, #2454, v4.0.162 2021-09-15 21:46:59 +08:00
Winlin
560e7c3c2f
Fix #2613, Try libopus and opus for ARM (#2614)
* Fix #2613, Try libopus and opus for ARM

* Refine code
2021-09-15 21:44:13 +08:00
winlin
28e3a1ca69 Squash: Merge SRS 4.0 2021-09-13 09:57:47 +08:00
winlin
6b20f4a787 Merge branch '4.0release' into merge/develop 2021-09-13 09:57:12 +08:00
winlin
b39a139824 Merge branch 'develop' into merge/develop 2021-09-13 09:57:08 +08:00
winlin
501b3833a1 RTMP: Remove bandwidth test 2021-09-13 09:41:21 +08:00
winlin
a830289d97 Squash: Merge SRS4.0 2021-09-07 08:20:43 +08:00
winlin
4d61863bb9 Merge branch '4.0release' into merge/develop 2021-09-07 08:18:43 +08:00
winlin
ca03c53c40 Merge branch 'develop' into merge/develop 2021-09-07 08:18:34 +08:00
Justin Kromlinger
a583d7efb4 Set empty HTTP paths to '/' to avoid malformed requests (#2329)
This resolves #1610.
2021-09-07 08:17:53 +08:00
Justin Kromlinger
8aee0169ce
Set empty HTTP paths to '/' to avoid malformed requests (#2329)
This resolves #1610.
2021-09-07 08:15:27 +08:00
Huachao Mao
ff9e2339c1
Fix stream api iterator not incremented (#2582) 2021-09-07 08:14:40 +08:00
Huachao Mao
53cb333713
Support pagination for stream api (#2572) 2021-09-06 10:10:53 +08:00
winlin
fef474d503 Squash: Merge 4.0 2021-09-05 15:05:06 +08:00
winlin
7f6185b127 Merge branch '4.0release' into merge/develop 2021-09-05 15:04:15 +08:00
winlin
da6f70f73b Merge branch 'develop' into merge/develop 2021-09-05 15:04:10 +08:00
winlin
eff225a800 Refine dockerfile 2021-09-05 14:58:47 +08:00
winlin
19c0a9eb4b Suqash: Merge 4.0 2021-09-05 14:17:41 +08:00
winlin
e5373c9390 Merge branch '4.0release' into merge/develop 2021-09-05 14:15:59 +08:00
winlin
fd32617677 Merge branch 'develop' into merge/develop 2021-09-05 14:14:29 +08:00
winlin
f316b8fbdf Release 4.0 dev5, v4.0.161 2021-09-05 14:12:26 +08:00
winlin
ec554e14d0 Merge #2581, Fix listen ipv6 and port. 4.0.161 2021-09-05 14:10:53 +08:00
ChenGH
3f94d26ca4
For #1920, refine rtmp listen ip and port check (#2581) 2021-09-05 14:05:28 +08:00
ChenGH
714e182096
fix srs_string_replace deap loop when new_str inclue old_str (#2580) 2021-09-04 22:29:21 +08:00
winlin
6bb11a72d0 For #2282, #2181, Move DVR async worker from SrsDvrPlan to global. 2021-09-04 12:42:23 +08:00
winlin
90b5ed2202 For #2282, #2181, Remove reload for dvr_apply. 4.0.160 2021-09-04 12:29:07 +08:00
BoringWednesday
1db155fa2f
SRT: Add member of adaptation_field and fix pos not add after memcpy. (#2066) 2021-09-04 10:26:07 +08:00
winlin
cf3129220d Log: Refine the tail help log, show last 30 lines 2021-08-31 17:54:01 +08:00
winlin
7ab3e4a86c Squash: Merge SRS 4.0 2021-08-28 09:03:06 +08:00
winlin
749a98acd6 Merge branch '4.0release' into merge/develop 2021-08-28 09:01:49 +08:00
winlin
a018bf8409 Merge branch 'develop' into merge/develop 2021-08-28 09:01:38 +08:00
winlin
b6d0c73cda For #1859, Enhancement: Add param and stream to on_connect. 4.0.159 2021-08-28 09:00:25 +08:00
pyw
7abc9b640a
SRT: fix srt stream play map error (#1890)
* fix url_sz memory out of bounds

* fix srt play map error

Co-authored-by: pengyouwei <pengyouwei@comtom.cn>
2021-08-28 08:56:20 +08:00
Matin Zadeh Dolatabad
7b14281367
Enhancement: Add param and stream to on_connect (#1859)
Add stream and param to hook call on_connect for better use
2021-08-28 08:55:26 +08:00
winlin
f86d6fd073 Squash: Merge SRS 4.0 2021-08-27 07:57:02 +08:00
winlin
4d6daeae23 Merge branch '4.0release' into merge/develop 2021-08-27 07:56:25 +08:00
winlin
a598d5ff62 Merge branch 'develop' into merge/develop 2021-08-27 07:56:21 +08:00
Haibo Chen
c4a64ee470 Use SrsAsyncCallWorker in http hooks instead, to covert to async call. (#2542)
* Use SrsAsyncCallWorker in http hooks instead, to covert to async call.

* delete invalid function
2021-08-27 07:49:33 +08:00
Haibo Chen
a7feedabc6
Use SrsAsyncCallWorker in http hooks instead, to covert to async call. (#2542)
* Use SrsAsyncCallWorker in http hooks instead, to covert to async call.

* delete invalid function
2021-08-27 07:44:19 +08:00
Haibo Chen
c8bf98e8e2 Support for multiple SPS/PPS, then pick the first one. (#2544) 2021-08-27 07:32:02 +08:00
Haibo Chen
826f5121c5
Support for multiple SPS/PPS, then pick the first one. (#2544) 2021-08-27 07:27:33 +08:00
winlin
38b0b1dab2 Squash: Fix ingest bug. Refine AUTHORS. 2021-08-25 08:11:44 +08:00
winlin
6e9f1a864c Merge 2021-08-25 08:04:23 +08:00
winlin
23730fa483 Update AUTHORS 2021-08-25 07:43:35 +08:00
winlin
2e8766515e Merge 2021-08-25 07:37:42 +08:00
winlin
573e3236da Merge branch 'develop' into merge/develop 2021-08-25 07:35:37 +08:00
winlin
ef2442b666 Update AUTHORS 2021-08-25 07:35:27 +08:00
rise
a00b4d2014
Ingest: Exit if child process redirect io failed (#2540)
* 修复子进程无法打开日志输出重定向导致的fork错误

srs进程fork后,未能输出重定向而返回错误,导致fork的子进程未能出。

* remove the var child_err

* Fixed IO redirection error detection

* Fixed BUG where lost during logs on normal start
2021-08-25 07:16:46 +08:00
winlin
0859fb5298 Update issue template 2021-08-18 08:12:37 +08:00
winlin
cee38ab1e6 Update issue template 2021-08-18 08:11:50 +08:00
winlin
be7b71294d Update issue template 2021-08-18 07:50:05 +08:00
winlin
85620a34f5 Squash: Fix rtc to rtmp sync timestamp using sender report. #2470 2021-08-17 07:25:03 +08:00
winlin
7ae9c882b4 Merge 2021-08-17 07:24:20 +08:00
winlin
e5f8825584 Merge branch 'develop' into merge/develop 2021-08-17 07:21:09 +08:00
winlin
0123125ec2 RTC: Fix rtc to rtmp sync timestamp using sender report. #2470 2021-08-17 07:20:34 +08:00
john
ea8cff6163
RTC: Fix rtc to rtmp sync timestamp using sender report. (#2470)
* fix annotation spell failed

* RTC to RTMP using SenderReport to sync av timestamp

* update pion/webrtc versio from v3.0.4 -> v3.0.13, auto config sender/receiver report

* Add rtc push flv play regression test

* Add unit test of ntp and av sync time

* Take flag CXX to makefile of utest

* Add annotation about rtc unit test

* Fix compiler error in C++98

* Add FFmpeg log callback funciton.
2021-08-17 06:32:35 +08:00
winlin
5e876277b6 Update README, move docs to trunk. 2021-08-16 09:15:02 +08:00
winlin
3d58e98d1c Squash: Support github actions for CI 2021-08-15 21:51:50 +08:00
winlin
1c825ce831 Merge 2021-08-15 21:51:05 +08:00
winlin
6cd7a8cc04 Merge branch 'develop' into merge/develop 2021-08-15 21:50:08 +08:00
winlin
5fc455ba3b RTC: Remove TestRtcBasic_Republish for random fail 2021-08-15 21:19:02 +08:00
winlin
140d180d08 Actions: Support push and pullrequest 2021-08-15 20:12:31 +08:00
winlin
d08f8fab8c Refine Dockerfile 2021-08-15 11:48:25 +08:00
winlin
445bbc9dda Merge 2021-08-15 11:33:07 +08:00
winlin
0f6be65b37 Merge branch 'develop' into merge/develop 2021-08-15 11:32:31 +08:00
winlin
a2df2a2402 Refine Dockerfile 2021-08-15 11:21:36 +08:00
winlin
121fed57d3 Actions: Remove v3 in 4.0, never trigger it 2021-08-15 08:09:42 +08:00
winlin
2fdb06299c Support utest and regression-test when release. v4.0.156 2021-08-14 22:24:23 +08:00
winlin
640436d8a6 Refine expose ports for SRS 4.0 2021-08-14 21:10:42 +08:00
winlin
785d1744fc Expose live streaming ports for SRS 3.0 2021-08-14 21:10:11 +08:00
winlin
cadefc34ae Support release SRS 4.0 2021-08-14 21:06:49 +08:00
winlin
becfb517bd Support Github Actions 2021-08-14 21:05:27 +08:00
winlin
32c79b49cc Support Github Actions to publish SRS. 4.0.155 2021-08-14 20:38:01 +08:00
winlin
7efae1b1d6 Squash: Update CodeQL 2021-08-14 16:43:46 +08:00
winlin
02ca63c546 Merge 2021-08-14 16:36:53 +08:00
winlin
18d76156a3 Merge branch 'develop' into merge/develop 2021-08-14 16:28:59 +08:00
winlin
94308253b7 Actions: Add github actions for CI 2021-08-14 16:16:56 +08:00
winlin
26de8c65ad Actions: Add github actions for CI 2021-08-14 15:57:46 +08:00
winlin
6d0af77fba Actions: Add github actions for CI 2021-08-14 15:53:21 +08:00
winlin
e22035b749 Squash: Fix RTC session info bug 2021-08-14 14:45:12 +08:00
winlin
864db8b78c Merge 2021-08-14 14:42:23 +08:00
winlin
f6c7a92fa0 Merge branch '4.0release' into merge/develop 2021-08-14 14:41:52 +08:00
Johnny
7c1d3edd36 RTC: fix SrsSessionInfo about copy assignment operator and comparison operator. 2021-08-14 14:39:01 +08:00
winlin
36cbe851ca RTC: Fix reousrce find bug 2021-08-14 14:37:05 +08:00
winlin
7c899a0afd Squash: Update version query. 2021-08-14 11:53:27 +08:00
winlin
4b3db5a56e Update 2021-08-14 11:52:59 +08:00
winlin
cd05ebdbb0 Merge branch 'develop' into merge/develop 2021-08-14 11:51:54 +08:00
winlin
34b97bf68d Release v4.0-d3, v4.0.153 2021-08-14 11:50:33 +08:00
winlin
cffd364d4d Update README 2021-08-13 15:00:55 +08:00
winlin
258f97de6f Update 2021-08-13 15:00:10 +08:00
winlin
3bee710ca3 Merge branch 'develop' into merge/develop 2021-08-13 14:59:27 +08:00
winlin
d8fe85606d Update README 2021-08-13 14:53:22 +08:00
winlin
9c0c35fa87 Update README 2021-08-13 14:52:49 +08:00
winlin
5cd8989fd8 Update README 2021-08-13 14:50:39 +08:00
winlin
1b6192e1b2 Update README 2021-08-13 14:50:11 +08:00
winlin
24431d35ac Squash: Merge SRS4 2021-08-13 14:29:32 +08:00
winlin
e05acbfcad Merge branch '4.0release' into merge/develop 2021-08-13 14:04:56 +08:00
winlin
ddd5c192fb Merge branch 'develop' into merge/develop 2021-08-13 14:04:52 +08:00
Haibo Chen
ab988abc59 For #2516, fix codec issue for G.711 or H.263. 4.0.152 2021-08-13 12:08:10 +08:00
Haibo Chen
aad90c7f42
fix coredump bug: caused by publish stream that codec is unsupport, sush as G.711, H.263 (#2526) 2021-08-13 12:05:28 +08:00
matthew1838
452ca7e88f
add server_id into http_hooks (#2521)
Co-authored-by: SK <liemlhd@LiemLes-Mac-Pro.local>
2021-08-11 10:38:22 +08:00
winlin
29dea37dbb Squash: Merge SRS4 2021-08-10 12:10:35 +08:00
winlin
6e62bb2704 Merge 2021-08-10 12:10:06 +08:00
winlin
f41eb05481 Merge branch 'develop' into merge/develop 2021-08-10 12:09:38 +08:00
Haibo Chen
dffc344747 RTC: For #1657, support http hooks n_play/stop/publish/unpublish (#2509)
* support http hooks for rtc: on_play/stop/publish/unpublish

* Update srs_app_rtc_conn.cpp

* Update srs_app_rtc_conn.cpp
2021-08-10 09:47:48 +08:00
Haibo Chen
345b691895
support http hooks for rtc: on_play/stop/publish/unpublish (#2509)
* support http hooks for rtc: on_play/stop/publish/unpublish

* Update srs_app_rtc_conn.cpp

* Update srs_app_rtc_conn.cpp
2021-08-10 09:41:20 +08:00
winlin
9bf5005bdd Squash: Merge SRS4 2021-08-08 00:30:08 +08:00
winlin
82745782cb Merge branch '4.0release' into merge/develop 2021-08-08 00:25:12 +08:00
winlin
bccd0ae8f0 Merge branch 'develop' into merge/develop 2021-08-08 00:25:07 +08:00
winlin
57f6eb09c1 Use 4.0 docker srs:4 2021-08-08 00:24:01 +08:00
winlin
42872e2500 Release v4.0.150 dev2 2021-08-07 23:43:24 +08:00
Haibo Chen
c048731049 Get original ip instead of proxy ip, for rtc api (#2514) v4.0.150 2021-08-07 23:41:16 +08:00
Haibo Chen
84d04adfff
get original ip instead of proxy ip, for rtc api (#2514) 2021-08-07 23:37:18 +08:00
winlin
92cbb1f072 Refine code 2021-08-07 23:33:20 +08:00
winlin
7739d8c7da Update README.md 2021-08-07 23:22:17 +08:00
winlin
adf0043cbc Fix #2508, Support features query by API. 5.0.10 2021-08-07 23:21:23 +08:00
winlin
05613ebbfc Merge branch '4.0release' into merge/develop 2021-08-07 23:20:40 +08:00
winlin
e05d433824 Merge branch 'develop' into merge/develop 2021-08-07 23:20:36 +08:00
winlin
ee376da0c6 Fix #2508, Support features query by API. 4.0.149 2021-08-07 23:17:15 +08:00
winlin
69faf06f0f API: For #2508, query feature docker and packager. 2021-08-07 21:35:00 +08:00
winlin
a948dfa675 Merge 2021-08-07 21:34:31 +08:00
winlin
db9a51b9b1 Merge branch 'develop' into merge/develop 2021-08-07 21:33:55 +08:00
winlin
86e506e6ec API: For #2508, query feature docker and packager. v4.0.148 2021-08-07 19:03:13 +08:00
winlin
983d521987 API: Use libuuid to generate uuid. v5.0.9 2021-08-06 22:02:46 +08:00
winlin
7fd7036036 Merge 2021-08-06 22:00:35 +08:00
winlin
ca01e73940 Merge branch 'develop' into merge/develop 2021-08-06 22:00:00 +08:00
winlin
48ef3dcd83 API: Use libuuid to generate uuid. v4.0.147 2021-08-06 21:53:16 +08:00
Haibo Chen
529b89a29e Fix #2504 coredump bug: caused by publish stream that codec is h.263 (#2505) 2021-08-04 17:14:41 +08:00
Haibo Chen
06f10b1894
fix coredump bug: caused by publish stream that codec is h.263 (#2505) 2021-08-04 17:06:55 +08:00
winlin
6ddef894d9 ST: Refine OSX asm. 2021-07-29 08:46:38 +08:00
winlin
e8bca303f9 Update README 2021-07-28 19:22:21 +08:00
winlin
74affb159e Merge branch '4.0release' into merge/develop 2021-07-26 20:11:58 +08:00
winlin
c492a7b7fb Merge branch 'develop' into merge/develop 2021-07-26 20:11:54 +08:00
Haibo Chen
82c149c9c8 correct the client ip of http-flv player, for statistic (#2491) 2021-07-26 20:07:45 +08:00
Haibo Chen
f62a4c4893
correct the client ip of http-flv player, for statistic (#2491) 2021-07-26 20:01:29 +08:00
winlin
de2c720272 Merge branch '4.0release' into merge/develop 2021-07-25 08:45:47 +08:00
winlin
a5816318f9 Update 2021-07-25 08:45:44 +08:00
winlin
7d4cae45c5 Release 4.0 dev1, v4.0.146 2021-07-25 08:43:00 +08:00
winlin
ed6f8689b4 Release 4.0 dev1, v4.0.146 2021-07-25 08:42:19 +08:00
winlin
301a8ceadb Squash: Merge SRS 4.0 2021-07-24 21:10:35 +08:00
winlin
1bd228e297 Merge branch '4.0release' into merge/develop 2021-07-24 21:09:34 +08:00
winlin
40e649dfbc RTC: Fix NACK negotiation bug for Firefox. 4.0.145 2021-07-24 21:07:28 +08:00
winlin
128d3484cb Merge branch '4.0release' into merge/develop 2021-07-24 21:03:33 +08:00
winlin
80fad01676 Merge branch 'develop' into merge/develop 2021-07-24 21:03:29 +08:00
Winlin
8c7ba05f9a
For #2371: Add regression test for SDP nack (#2487)
* explicitly enable nack, for firefox (#2373)

* For #2371: Add regression test for SDP nack

1. Refine API to change defaule decodes.
2. Add test for publish SDP nack.
3. Add test for play SDP nack.

Co-authored-by: Haibo Chen <495810242@qq.com>
2021-07-24 21:03:00 +08:00
Haibo Chen
43bb9660ca explicitly enable nack, for firefox (#2373) 2021-07-24 20:49:12 +08:00
Haibo Chen
fb73d42c38
explicitly enable nack, for firefox (#2373) 2021-07-24 20:47:34 +08:00
Winlin
fe5a14568b
For #2483, add regression test for RTC stat API (#2486) 2021-07-24 20:46:58 +08:00
winlin
1c80b529f8 Squash: Merge SRS 4.0 2021-07-24 08:20:05 +08:00
winlin
11ae7abceb Merge branch '4.0release' into merge/develop 2021-07-24 08:09:58 +08:00
winlin
a71c6426b8 Merge branch 'develop' into merge/develop 2021-07-24 08:09:54 +08:00
Haibo Chen
86c67f7d95 RTC: Support statistic for HTTP-API, HTTP-Callback and Security (#2483) v4.0.144
* commit message for your changes. Lines starting

* Update srs_app_rtc_api.cpp

* add SrsRtcConnPlay and SrsRtcConnPublish, in enum SrsRtmpConnType

* Update srs_rtmp_stack.cpp

* Update srs_app_rtc_conn.cpp

* Update srs_app_rtc_api.cpp

* update utest

* Update srs_utest_app.cpp
2021-07-24 08:08:35 +08:00
Haibo Chen
0efd7b1bbc
RTC: Support statistic for HTTP-API, HTTP-Callback and Security (#2483)
* commit message for your changes. Lines starting

* Update srs_app_rtc_api.cpp

* add SrsRtcConnPlay and SrsRtcConnPublish, in enum SrsRtmpConnType

* Update srs_rtmp_stack.cpp

* Update srs_app_rtc_conn.cpp

* Update srs_app_rtc_api.cpp

* update utest

* Update srs_utest_app.cpp
2021-07-24 08:05:10 +08:00
winlin
20931ddbb1 Squash: Fix README.md link issue 2021-07-21 18:22:53 +08:00
winlin
c7415ab384 Merge branch 'develop' into merge/develop 2021-07-21 18:22:20 +08:00
winlin
cb0dcc2918 Merge branch '4.0release' into merge/develop 2021-07-21 18:22:16 +08:00
winlin
4332beed79 Fix README.md link issue 2021-07-21 18:21:19 +08:00
winlin
33610c6865 Squash: Merge SRS 4.0 2021-07-21 10:36:07 +08:00
winlin
7f14085e6f Merge branch 'develop' into merge/develop 2021-07-21 10:35:00 +08:00
winlin
cfcccb6716 Merge 2021-07-21 10:34:56 +08:00
Alex.CR
af05f89925 SRT: Use thread-safe log for multiple-threading SRT module. (#2474) v4.0.143
* solve srt push bugs

* solve h264 mutiple nalus in srt when obs is configured in zerolatency

* optimize error code

* optimize error code

* optimize error code

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* optimize srt log system

* update conf

* update srt hpp

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-07-21 10:28:42 +08:00
Alex.CR
4b7ba0e1e9 SRT: Use thread-safe log for multiple-threading SRT module. (#2474)
* solve srt push bugs

* solve h264 mutiple nalus in srt when obs is configured in zerolatency

* optimize error code

* optimize error code

* optimize error code

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* optimize srt log system

* update conf

* update srt hpp

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-07-21 10:23:25 +08:00
winlin
4ca433d3f8 Refine push script 2021-07-19 07:51:35 +08:00
winlin
6c40419de7 Fix configure bug 2021-07-19 07:49:57 +08:00
winlin
486b838397 Add badge for CodeQL, security scan 2021-07-17 19:57:15 +08:00
winlin
d1cb123a60 Add badge for CodeQL, security scan 2021-07-17 19:56:04 +08:00
winlin
beea3216fe Squash: Refine IDE 2021-07-17 19:50:35 +08:00
winlin
a58d24f71e Merge branch '4.0release' into merge/develop 2021-07-17 19:48:33 +08:00
winlin
cc9c74850c Merge branch 'develop' into merge/develop 2021-07-17 19:48:29 +08:00
winlin
169f08bae1 [IDE] We should always configure SRS for switching between branches. 2021-07-17 19:48:14 +08:00
winlin
97c627f9d4 Squash: Support CLion 2021-07-17 19:43:22 +08:00
winlin
8e66e2ac96 Merge branch '4.0release' into merge/develop 2021-07-17 19:38:41 +08:00
winlin
526c6772c5 Merge branch 'develop' into merge/develop 2021-07-17 19:38:38 +08:00
winlin
afa32910c9 Fix bugs and enhance code. 4.0.142 2021-07-17 19:16:26 +08:00
winlin
66a696efe0 [IDE] Refine .gitignore for cmake from ide/srs_clion 2021-07-16 22:37:09 +08:00
winlin
2e222d369d [IDE] Refine CMakeLists.txt, use absolute path 2021-07-16 22:29:51 +08:00
winlin
c209e547a8 [IDE] Support CLion and cmake to build and debug SRS. 4.0.141
1. Remove all except JetBrains clion by cmake
2. Add .run/srs.run.xml for debugging for CLion.
3. Auto configure SRS when load CMakeLists.txt
2021-07-16 11:38:12 +08:00
winlin
12ba584ea3 Fix build failed 2021-07-09 09:00:35 +08:00
winlin
dca0397c47 Update README 2021-07-09 08:13:36 +08:00
winlin
3182dee1c5 Update README.md 2021-07-08 18:03:38 +08:00
winlin
8f91a90f28 Squash: Fix padding packets for RTMP2RTC 2021-07-08 14:37:18 +08:00
winlin
a47c55a171 Merge branch '4.0release' into merge/develop 2021-07-08 14:36:23 +08:00
winlin
1e27fec8de Merge branch 'develop' into merge/develop 2021-07-08 14:36:17 +08:00
winlin
73e8133e84 Merge branch 'develop' into merge/develop 2021-07-08 14:32:56 +08:00
Winlin
c8a1e0f3da
Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8 (#2464)
* Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8

* Update README.md

* Update README.md

* Refine format for AUTHORS.md
2021-07-08 14:30:47 +08:00
Haibo Chen
90b7933dbb For #2403, fix padding packets for RTMP2RTC. 4.0.140.
Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy (#2461)

* Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy

* make clear for magic number

make clear for magic number

* Update srs_app_rtc_source.cpp
2021-07-08 14:27:51 +08:00
winlin
10b9a81061 RTC: Support eip/candidate to set the eip of server 2021-07-08 14:25:38 +08:00
Haibo Chen
7eee9aa598
Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy (#2461)
* Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy

* make clear for magic number

make clear for magic number

* Update srs_app_rtc_source.cpp
2021-07-08 14:23:53 +08:00
winlin
b121f5f588 Update SRS 4.0 docker 2021-07-08 12:56:43 +08:00
Winlin
77c958ad1c
RTC: Trim SDP line space for pion/webrtc client. (#2466) 2021-07-08 09:54:55 +08:00
winlin
56310ffd9d Refine .curcleci workflow 2021-07-07 08:38:30 +08:00
winlin
481f8b203c Refine .curcleci workflow 2021-07-07 08:36:27 +08:00
winlin
14bc799029 Refine .curcleci workflow 2021-07-07 08:34:02 +08:00
winlin
5beea97e8e Refine .curcleci workflow 2021-07-07 08:32:07 +08:00
winlin
5a7a742f36 Squash: Update README 2021-07-06 11:37:31 +08:00
winlin
2538a74e36 Merge branch '4.0release' into merge/develop 2021-07-06 11:24:22 +08:00
winlin
ce1b09da28 Merge branch 'develop' into merge/develop 2021-07-06 11:24:16 +08:00
winlin
67ebd08342 Add role(srs) to query versions 2021-07-06 11:22:16 +08:00
winlin
a88eb5242e Update README.md 2021-07-04 17:04:57 +08:00
winlin
13d015b8fd Squash: Fix random bug 2021-07-04 16:04:51 +08:00
winlin
dace2452d5 Merge 2021-07-04 16:03:27 +08:00
winlin
fd375096d8 Merge branch 'develop' into merge/develop 2021-07-04 16:02:47 +08:00
winlin
642359a50e For #2424, use srandom/random to generate. 4.0.139 2021-07-04 15:50:29 +08:00
winlin
db3e11152e Move AUTHORS.txt to trunk for docker. 5.0.7 2021-07-01 06:30:24 +08:00
winlin
e1a3dfb076 Merge branch '4.0release' into merge/develop 2021-07-01 06:27:12 +08:00
winlin
67adefd391 Merge branch 'develop' into merge/develop 2021-07-01 06:27:08 +08:00
winlin
e802fe5bd6 Release 4.0.138 2021-07-01 06:25:36 +08:00
Haibo Chen
03c5f76e64 update channel_layout by channels, for ffmpeg transcode opus to aac success (#2452) 2021-07-01 06:23:29 +08:00
Haibo Chen
d32d8c0da6
update channel_layout by channels, for ffmpeg transcode opus to aac success (#2452) 2021-07-01 06:22:16 +08:00
winlin
9f5d011687 Squash: Fix build fail for arm/aarch64 2021-06-30 10:28:23 +08:00
winlin
46c9e88d8a Merge branch '4.0release' into merge/develop 2021-06-30 10:27:02 +08:00
winlin
e916611116 Merge branch 'develop' into merge/develop 2021-06-30 10:26:57 +08:00
winlin
b8dcf20237 Fix build fail for arm/aarch64 2021-06-30 10:02:05 +08:00
winlin
81a5c1b8da Move AUTHORS.txt to trunk for docker to access it 2021-06-30 08:20:53 +08:00
winlin
75530efbc4 Squash: Merge #2448, #2440 2021-06-30 07:32:28 +08:00
winlin
2bd0deac47 Merge branch '4.0release' into merge/develop 2021-06-30 07:29:22 +08:00
winlin
7ad022c540 Merge branch 'develop' into merge/develop 2021-06-30 07:29:18 +08:00
winlin
ef43532cf4 Merge #2440, fix #2390, SRT bug for zerolatency. 4.0.137 2021-06-30 07:26:45 +08:00
Alex.CR
7e164b0061 SRT: Fix bug for multiple NALUs, when configure OBS in zerolatency. (#2440)
* solve srt push bugs

* solve h264 mutiple nalus in srt when obs is configured in zerolatency

* optimize error code

* optimize error code

* optimize error code

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* add commemnt:we only skip pps/sps frame and send left nalus in srt

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-06-30 07:26:40 +08:00
long
cff4c07be4
打开rtmp转rtc,当rtmp重复推流时,第2路会影响第1路流的正常播放。 (#2448)
* Update srs_app_rtmp_conn.cpp

修复推重复的RTMP流导致的RTC和RTMP播放的问题

* change ERROR_RTC_SOURCE_BUSY to ERROR_SYSTEM_STREAM_BUSY

change ERROR_RTC_SOURCE_BUSY to ERROR_SYSTEM_STREAM_BUSY

Co-authored-by: Haibo Chen <495810242@qq.com>
2021-06-30 07:24:12 +08:00
Alex.CR
346cc96d7a
SRT: Fix bug for multiple NALUs, when configure OBS in zerolatency. (#2440)
* solve srt push bugs

* solve h264 mutiple nalus in srt when obs is configured in zerolatency

* optimize error code

* optimize error code

* optimize error code

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* add commemnt:we only skip pps/sps frame and send left nalus in srt

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-06-30 07:14:56 +08:00
winlin
cbca6d94d1 Add API path document 2021-06-28 14:45:33 +08:00
winlin
98e56f5325 Refine the random id by srs_random_str 2021-06-28 08:34:00 +08:00
winlin
0391e71682 Squash: Merge SRS4 2021-06-28 08:02:49 +08:00
winlin
d166354498 Merge branch '4.0release' into merge/develop 2021-06-28 08:01:47 +08:00
winlin
a64827c0dd Merge branch 'develop' into merge/develop 2021-06-28 08:01:42 +08:00
winlin
6ea270adf3 Merge #2435, fix #2015, fix bug for HTTP-RAW-API to check vhost. 4.0.136 2021-06-28 07:54:50 +08:00
Xiaoniu
31679c46d4 check 'vhost' validity in 'http raw dvr api' (#2435) 2021-06-28 07:53:16 +08:00
Xiaoniu
f986b5956b
check 'vhost' validity in 'http raw dvr api' (#2435) 2021-06-28 07:51:57 +08:00
winlin
d02ba80db1 Squash: Fix bug for building FFmpeg 2021-06-28 07:51:02 +08:00
winlin
13ccf50773 Merge branch '4.0release' into merge/develop 2021-06-28 07:50:16 +08:00
winlin
ae27bef823 Merge branch 'develop' into merge/develop 2021-06-28 07:50:13 +08:00
winlin
bfae75077e Fix #2431, configure FFmpeg bug. 4.0.135 2021-06-28 07:46:13 +08:00
winlin
c8d8581d4b For #2444, add libavcodec/crystalhd.c for FFmpeg. 4.0.134 2021-06-28 07:39:24 +08:00
Hung-Yi Chen
bbd9d864d5
Add missing ffmpeg-4-fit/libavcodec/crystalhd.c from ffmpeg 4.2, #2271 (#2444) 2021-06-28 07:35:52 +08:00
winlin
5ee20613ca Squash: Support query lastest available version. 5.0.6 2021-06-28 07:33:24 +08:00
winlin
6dc9ac311a Merge 2021-06-28 07:31:58 +08:00
winlin
6fa9f33f27 Merge branch 'develop' into merge/develop 2021-06-28 07:30:24 +08:00
Xiaoniu
7bf03ef2ba Fix #2068, losing of last HLS ts file 4.0.133
fix bug: last segment of ts not trigger 'on_hls',
because of 'on_unpublish' earlier than 'segment_close' (#2438)
2021-06-28 07:28:46 +08:00
Xiaoniu
d987e194ff
fix bug: last segment of ts not trigger 'on_hls', because of 'on_unpublish' earlier than 'segment_close' (#2438) 2021-06-28 07:25:25 +08:00
winlin
aa12251084 Fix bug for v3.0-r6 2021-06-27 10:11:15 +08:00
winlin
da763e43d5 Squash for #2424, query the latest available version. 4.0.132 2021-06-27 08:56:41 +08:00
winlin
332732c48c Merge #2429 to fix SRT bug. 4.0.131 2021-06-24 22:14:13 +08:00
winlin
ce47d5cc28 Squash: Update README 2021-06-24 22:11:19 +08:00
winlin
32bb99988e Merge 2021-06-24 22:10:31 +08:00
winlin
f2fd184578 Merge branch '4.0release' into merge/develop 2021-06-24 22:09:59 +08:00
winlin
6ec1a383fa Merge #2419 to fix SRT bug. 4.0.131 2021-06-24 22:09:09 +08:00
winlin
25262dd3cb Fix SRT bug. 4.0.131 2021-06-24 22:07:48 +08:00
Alex.CR
bb9aefd869 srt publish core dump bug (#2429)
* solve srt push bugs

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-06-24 22:03:59 +08:00
Alex.CR
67ac720b92
srt publish core dump bug (#2429)
* solve srt push bugs

Co-authored-by: shiwei <shiwei05@kuaishou.com>
2021-06-24 22:03:18 +08:00
winlin
a594678e3d Squash #1685, #1282, #1547: Support ARM platform. 5.0.5 2021-06-22 07:49:48 +08:00
winlin
c183125af9 Merge branch '4.0release' into merge/develop 2021-06-22 07:46:19 +08:00
winlin
fed57f6f17 Refine scripts 2021-06-22 07:45:26 +08:00
winlin
27cac7f68e Merge 2021-06-22 07:25:47 +08:00
winlin
5906345a97 Fix #2413, fix RTMP to RTC bug 4.0.130 2021-06-21 14:37:41 +08:00
john
1347da81f8
Check audio/video track when rtc stream updated (#2418) 2021-06-21 14:35:37 +08:00
winlin
3aba2f3479 Add machine to build dir 2021-06-21 14:05:46 +08:00
winlin
2376c4cebb Add BBS link 2021-06-20 20:17:25 +08:00
winlin
fcb2b3da2c Update README 2021-06-20 19:44:39 +08:00
winlin
bc35a1fc4c Update README 2021-06-20 19:43:02 +08:00
winlin
1f0b5f0495 Update README 2021-06-20 19:39:26 +08:00
winlin
1254f5b1d4 Update README 2021-06-20 19:38:40 +08:00
winlin
52fb6aed10 Merge 2021-06-20 17:30:59 +08:00
winlin
92327b6e20 Merge branch 'develop' into merge/develop 2021-06-20 17:26:10 +08:00
winlin
70e552ef23 Guess where FFmpeg is. 4.0.129 2021-06-20 17:08:09 +08:00
winlin
6038276b4e Fix bug for build on osx 2021-06-20 17:01:50 +08:00
winlin
440883e6e6 Fix bug for 'make st' 2021-06-20 16:56:25 +08:00
winlin
4969156355 Add CI for armv7 and aarch64 2021-06-20 15:20:30 +08:00
winlin
593391e765 Add CI for armv7 and aarch64 2021-06-20 15:20:00 +08:00
winlin
a52e7c08ea Update AUTHORS 2021-06-20 15:15:47 +08:00
winlin
229578cc65 Fix #1685, support RTC cross-build for armv7/armv8(aarch64). 4.0.128 2021-06-20 15:11:54 +08:00
winlin
1e9de0e191 For #1685: Cross build RTC with FFmpeg 2021-06-19 21:55:12 +08:00
winlin
1c75a270b3 RTC: Eliminate dead code. 2021-06-17 10:52:00 +08:00
winlin
623a453787 Fix #2214, remove detection for gmc and gmp. 2021-06-17 08:39:19 +08:00
winlin
efdbf37255 Squash: Move GB28181 to feature/gb28181. 5.0.4 2021-06-16 14:03:55 +08:00
winlin
ca2654f6a7 Merge branch '4.0release' into merge/develop 2021-06-16 14:03:01 +08:00
winlin
df20fe6c9d Fix build fail 2021-06-16 14:02:48 +08:00
winlin
c5227c4831 Update 2021-06-16 13:45:12 +08:00
winlin
9932ad83b6 Merge branch 'develop' into merge/develop 2021-06-16 13:43:35 +08:00
winlin
4f44c3c995 Fix build fail 2021-06-16 13:43:25 +08:00
winlin
17a8fee8c4 Tag 5.0.4 2021-06-16 13:41:40 +08:00
winlin
0a2a5d2145 Squash: Move GB28181 to feature/gb28181. 2021-06-16 13:40:54 +08:00
winlin
d2a4e08ba0 Merge 2021-06-16 13:39:22 +08:00
winlin
2e3443c84a Merge branch 'develop' into merge/develop 2021-06-16 13:38:47 +08:00
winlin
863f91ddb4 Fix build fail 2021-06-16 08:43:33 +08:00
winlin
68c48e27f5 Change GB28181 to feature/gb28181. 4.0.127 2021-06-16 08:27:37 +08:00
winlin
49826081b1 Squash: Update README 2021-06-15 16:11:29 +08:00
winlin
e16c0269c1 Merge branch 'develop' into merge/develop 2021-06-15 16:10:45 +08:00
winlin
8350b7a4e3 Merge branch '4.0release' into merge/develop 2021-06-15 16:10:35 +08:00
winlin
4e93696bc6 Update README 2021-06-15 15:55:52 +08:00
winlin
283b3a2cee Squash: Update README 2021-06-15 15:51:28 +08:00
winlin
4b211380c2 Update 2021-06-15 15:50:07 +08:00
winlin
77677025bd Merge 2021-06-15 15:45:49 +08:00
winlin
6596f92b54 Update 2021-06-13 09:58:25 +08:00
winlin
8717d84472 Refine README 2021-06-13 08:36:12 +08:00
winlin
a7df9788a6 Squash: Refine README 2021-06-10 20:55:57 +08:00
winlin
0ebf16d29e Merge branch '4.0release' into merge/develop 2021-06-10 20:52:34 +08:00
winlin
9d028d3605 Refine README.md 2021-06-10 20:46:25 +08:00
winlin
d84770afc5 Merge 2021-06-10 20:43:52 +08:00
winlin
e0f8d0976e Merge branch 'develop' into merge/develop 2021-06-10 20:42:29 +08:00
winlin
e41b3bd37c Fix typo 2021-06-10 20:24:11 +08:00
winlin
1188bcc325 Update README 2021-06-10 14:16:42 +08:00
winlin
9c96d20126 Update README 2021-06-10 14:12:24 +08:00
winlin
d51d1f7d8f Refine README 2021-06-10 14:03:13 +08:00
winlin
dfb0887e1d Extract CHANGELOG.md 2021-06-10 13:39:58 +08:00
winlin
f75ef2f808 Build: Support --shared-ffmpeg 2021-06-01 15:39:37 +08:00
winlin
dbe7779fc8 Merge branch '4.0release' into merge/develop 2021-06-01 15:38:42 +08:00
winlin
f5a769c22e Merge branch 'develop' into merge/develop 2021-06-01 15:38:38 +08:00
winlin
d5266725e2 Build: Support --shared-ffmpeg to link with *.so for LGPL license. 4.0.126 2021-06-01 15:34:31 +08:00
winlin
d1d0b9ca5c Doc: Update 3rdparty links 2021-06-01 14:17:42 +08:00
winlin
785d2fce08 Build: Support --shared-srt 2021-06-01 12:29:22 +08:00
winlin
9e9aaa8ed9 Merge branch '4.0release' into merge/develop 2021-06-01 12:28:23 +08:00
winlin
33fe0a5d13 Merge branch 'develop' into merge/develop 2021-06-01 12:28:19 +08:00
winlin
f44224a2a1 Build: Support --shared-srt to link with *.so for MPL license. 4.0.125 2021-06-01 12:24:13 +08:00
winlin
8434271578 Build: Refine configure option help 2021-06-01 11:44:14 +08:00
winlin
7e657ae654 Refine AUTHORS format 2021-06-01 09:36:28 +08:00
winlin
71bb8f8a05 Merge branch '4.0release' into merge/develop 2021-06-01 09:35:47 +08:00
winlin
afeeddd821 Merge branch 'develop' into merge/develop 2021-06-01 09:35:42 +08:00
winlin
689100f651 Refine AUTHORS format 2021-06-01 09:04:38 +08:00
winlin
9e2c6d458e Fix build fail for SPDX 2021-05-31 13:46:19 +08:00
winlin
97749d2b02 Merge branch '4.0release' into merge/develop 2021-05-31 13:45:59 +08:00
winlin
301d20eac8 Merge branch 'develop' into merge/develop 2021-05-31 13:45:57 +08:00
winlin
67272f0721 Fix build fail for SPDX 2021-05-31 13:45:23 +08:00
winlin
15901cacee SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3 2021-05-31 13:42:20 +08:00
winlin
5e0f1f8034 Update 2021-05-31 13:38:51 +08:00
winlin
e90321334e Merge branch '4.0release' into merge/develop 2021-05-31 13:37:24 +08:00
winlin
9418e7d064 Merge branch 'develop' into merge/develop 2021-05-31 13:37:20 +08:00
winlin
0777ee9cab Update README.md 2021-05-31 13:36:30 +08:00
winlin
3cd22b6e6e Use SPDX-License-Identifier: MIT. 4.0.124 2021-05-31 12:59:21 +08:00
winlin
4cf1f852cf Fix bugs for GB28181 and RTC. 4.0.123 2021-05-28 22:23:17 +08:00
johzzy
7be6025546 fix: fix typo about inactive. (#2380) 2021-05-28 22:20:36 +08:00
johzzy
2aad8ad5bd
fix: fix typo about inactive. (#2380) 2021-05-28 22:20:04 +08:00
winlin
81bda41b31 SquashSRS4: Refine srs.sdk.js 2021-05-28 21:44:51 +08:00
winlin
665bae9b44 Update 2021-05-28 21:43:39 +08:00
winlin
4e79e91ede Merge branch '4.0release' into merge/develop 2021-05-28 21:43:08 +08:00
winlin
a8d40f4cb1 Update AUTHORS 2021-05-28 21:40:43 +08:00
louis.xia
1c7c74b01a GB28181: Fix parse rtp tcp failed (#2382)
* fix parse rtp-tcp failed

* fix parse rtp-tcp failed

* fix gb28181 support tcp stack is setup:passive

* Update push.gb28181.tcp.conf

Co-authored-by: cfw <fangwei.cheng@transwarp.io>
Co-authored-by: Winlin <winlin@vip.126.com>
2021-05-28 21:38:52 +08:00
louis.xia
cc52e5b27c
GB28181: Fix parse rtp tcp failed (#2382)
* fix parse rtp-tcp failed

* fix parse rtp-tcp failed

* fix gb28181 support tcp stack is setup:passive

* Update push.gb28181.tcp.conf

Co-authored-by: cfw <fangwei.cheng@transwarp.io>
Co-authored-by: Winlin <winlin@vip.126.com>
2021-05-28 21:38:12 +08:00
cfw11
3e7536c493 GB28181: fix parse rtp-tcp failed (#2378)
* fix parse rtp-tcp failed

* fix parse rtp-tcp failed

Co-authored-by: cfw <fangwei.cheng@transwarp.io>
2021-05-28 21:20:41 +08:00
cfw11
4d6f00e6bf
GB28181: fix parse rtp-tcp failed (#2378)
* fix parse rtp-tcp failed

* fix parse rtp-tcp failed

Co-authored-by: cfw <fangwei.cheng@transwarp.io>
2021-05-28 21:19:05 +08:00
winlin
f270d42849 Update README.md 2021-05-27 13:44:46 +08:00
winlin
295ef90815 SRS: Update README.md 2021-05-27 11:13:31 +08:00
winlin
c353f1fe57 Update Usage 2021-05-26 14:21:23 +08:00
winlin
bd1ec99d5b Demo: Update srs.sdk.js 2021-05-25 16:04:44 +08:00
winlin
463105c012 Refine README.md 2021-05-25 14:39:47 +08:00
winlin
bbd7ee08d4 Update README.md 2021-05-24 15:19:49 +08:00
winlin
4cfde4fa08 Merge 2021-05-24 15:19:06 +08:00
winlin
a00bb76d13 Merge branch 'develop' into merge/develop 2021-05-24 15:18:10 +08:00
winlin
3cdd1c4e66 Update README.md 2021-05-24 15:12:36 +08:00
winlin
7fcafef6c4 Refine README.md 2021-05-24 14:45:19 +08:00
winlin
a9f171144d SquashSRS4: Eliminate dead code 2021-05-24 08:17:59 +08:00
winlin
3e1b9a545c Merge 2021-05-24 08:17:14 +08:00
winlin
9d2e5a7333 Merge branch '4.0release' into merge/develop 2021-05-24 08:16:50 +08:00
winlin
8e79b90bc3 RTC: Eliminate dead code. 4.0.122 2021-05-24 08:11:42 +08:00
winlin
5afa8edd01 Update README, eliminate unused wikis. 2021-05-21 20:32:10 +08:00
winlin
e50582f9c7 SquashSRS4: Refine SDK 2021-05-21 19:57:59 +08:00
winlin
f42acb4c48 Merge branch '4.0release' into merge/develop 2021-05-21 19:57:23 +08:00
winlin
da7413d5e0 Merge branch 'develop' into merge/develop 2021-05-21 19:57:19 +08:00
winlin
5df90a2a1c Fix #2370 bug for Firefox play stream(published by Chrome). 4.0.121 2021-05-21 18:56:19 +08:00
winlin
7ea05dddf2 RTC: Allow set constrain for publisher 2021-05-21 18:32:53 +08:00
winlin
9ed388523f RTC: Refine demo H5 page 2021-05-21 17:26:52 +08:00
winlin
a7ab78a588 SquashSRS4: Update SDK 2021-05-21 17:14:04 +08:00
winlin
586bbf9f53 Merge branch '4.0release' into merge/develop 2021-05-21 17:13:08 +08:00
winlin
3b3615bb17 Merge branch 'develop' into merge/develop 2021-05-21 17:13:04 +08:00
winlin
37c9066636 RTC: Refine sdk, migrate from onaddstream to ontrack. 4.0.120 2021-05-21 16:58:21 +08:00
winlin
c5c0a3e1b0 Refine doc 2021-05-21 09:19:17 +08:00
winlin
1ba0b20b74 Refine commens 2021-05-21 08:48:19 +08:00
winlin
0c1e60c8df Tools: Refine configure options. 4.0.119 2021-05-21 08:31:10 +08:00
winlin
6dc8d9dd6f SquashSRS4: Remove srs-librtmp 2021-05-20 20:07:13 +08:00
winlin
365b367ad4 Merge branch '4.0release' into merge/develop 2021-05-20 20:06:30 +08:00
winlin
9e5c4e2c5b RTC: Fix build fail 2021-05-20 19:56:23 +08:00
winlin
a01e2d062c Merge branch '4.0release' into merge/develop 2021-05-20 19:09:19 +08:00
winlin
7482aaf60a Merge branch 'develop' into merge/develop 2021-05-20 19:09:16 +08:00
winlin
fc9363e7df Fix build fail when disable RTC by --rtc=off. 4.0.118 2021-05-20 19:06:45 +08:00
winlin
af04285baa Tools: Remove srs-librtmp 2021-05-20 18:52:21 +08:00
winlin
3fb6433c9e Tools: Ignore some unused options 2021-05-20 18:31:00 +08:00
winlin
55baa81cea Tools: Refine --arm with --rtc=off 2021-05-20 18:20:52 +08:00
chenhaibo
bd506da070 Fix #2366, bug when disabled gb28181. 2021-05-20 17:27:32 +08:00
winlin
8f304b94ec Refine comments 2021-05-20 10:49:42 +08:00
winlin
f043a7eb48 SquashSRS4: Allow RTC play before publish. 2021-05-19 21:06:17 +08:00
winlin
5251ac9cca Merge branch '4.0release' into merge/develop 2021-05-19 21:04:40 +08:00
winlin
3f3c62b673 Merge branch 'develop' into merge/develop 2021-05-19 21:04:34 +08:00
root
d55af6be44 Fix #2362: Allow WebRTC to play before publishing, for GB28181 as such. 4.0.117 2021-05-19 20:54:22 +08:00
winlin
ef617b5fc6 Demo: Refine H5 demo page 2021-05-19 20:54:22 +08:00
Xiaoniu
75607d0723 Fix #2364: Live: Fail for stream busy if GB28181 is publishing. 2021-05-19 20:54:22 +08:00
winlin
442cf615c0 ST: Simplify it, only Linux/Darwin, epoll/kqueue, single process. 5.0.2
commit f4872e528cad07f8ea683cc8cb26e34111bad1b5
Author: winlin <winlin@vip.126.com>
Date:   Fri Feb 26 09:13:21 2021 +0800

    ST: For #2188: Remove sendmmsg from ST.

commit aaeb8919bd4a026268e0600398cb1e9ad477663f
Author: winlin <winlin@vip.126.com>
Date:   Thu Mar 11 08:09:54 2021 +0800

    ST: Refine utest script.

commit d1ac9da53060b6bfa82b5d041da4c2ad9bd6b90a
Author: winlin <winlin@vip.126.com>
Date:   Wed Mar 3 11:02:25 2021 +0800

    ST: Support fast utest and coverage

commit 8400115b83c022e33f59422dbf6d85ee46fb9edb
Author: winlin <winlin@vip.126.com>
Date:   Fri Feb 26 07:02:19 2021 +0800

    ST: Always use unserialized accept for linux or darwin

commit c3686f2bca80d2c139239b08975575b1bb981ffa
Author: winlin <winlin@vip.126.com>
Date:   Fri Feb 26 06:54:05 2021 +0800

    ST: Refine ARFLAGS by disable the verbose log

commit aaa5c4f863eba278c4ed2b29a46297fb01a4ed63
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 08:58:46 2021 +0800

    ST: Stack always grows from top to down.

commit dddd466e5c2e418c6f4896cd8bf701130052b3d9
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 08:51:31 2021 +0800

    ST: Ignore process fork, for single process only

commit 7906cb5f6e78c916cb8b8d9522275bfc086bb6a3
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 08:50:59 2021 +0800

    ST: Fix build warnings

commit d94921b84a3b6cf88ace2c766cc2bfedb9c0602e
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 07:27:45 2021 +0800

    ST: Remove select and poll support, only epoll and kqueue

commit 76d202514615f78d1a8f2b15778f3dac5abf4abb
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 07:10:47 2021 +0800

    ST: Remove multiple OS support, except Linux and Darwin.

commit 13c4ba345c61170e86dde486a174378ca235f442
Author: winlin <winlin@vip.126.com>
Date:   Thu Feb 25 06:59:35 2021 +0800

    ST: Remove __ia64__ CPU support

commit 46c06e4a11879cfeb828382e44f11287782ce4b5
Author: winlin <winlin@vip.126.com>
Date:   Wed Feb 24 11:37:27 2021 +0800

    ST: Remove unused files for ST
2021-05-19 18:25:49 +08:00
winlin
9709ca3b7e Doc: Update README 2021-05-19 18:21:43 +08:00
winlin
626cba13b3 Merge branch 'develop' into merge/develop 2021-05-19 18:21:06 +08:00
winlin
f1296aee26 Merge branch '4.0release' into merge/develop 2021-05-19 18:21:02 +08:00
winlin
36b769deee Doc: Update README 2021-05-19 11:08:45 +08:00
winlin
34aa11b72a SquashSRS4: Update doc 2021-05-18 11:47:50 +08:00
winlin
98cd8145cc Merge branch '4.0release' into merge/develop 2021-05-18 11:46:46 +08:00
winlin
8d5e27a309 Merge branch 'develop' into merge/develop 2021-05-18 11:46:39 +08:00
winlin
476e114cc4 Update doc 2021-05-18 11:42:01 +08:00
winlin
0d14c4b073 System: Fail if use use full.conf 2021-05-18 11:06:14 +08:00
xialixin
2e14d80aa4 SquashSRS4: Refine GB28181 2021-05-18 09:11:57 +08:00
winlin
cc56102c9e Merge branch '4.0release' into merge/develop 2021-05-18 09:10:11 +08:00
winlin
721865815e Merge branch 'develop' into merge/develop 2021-05-18 09:10:08 +08:00
winlin
1bd6bfd142 GB28181: Rename sip and jitter file. 2021-05-18 09:03:16 +08:00
xialixin
4c2b19a264 GB28181: Refine for bad network, we can wait for more incomplete frames 2021-05-18 08:53:51 +08:00
xialixin
7d8bde3cdb Fix #2355: GB28181: Fix play by RTC bug. 4.0.116 2021-05-18 08:42:01 +08:00
winlin
4639510f1b RTC: Allow config perf_stat and queue_length of rtc_server 2021-05-17 18:23:54 +08:00
winlin
e3bca883e1 SuqashSRS4: Build SRT native 2021-05-16 16:14:00 +08:00
winlin
44c8658bb0 Merge 2021-05-16 13:53:53 +08:00
winlin
d8e41cd283 Merge branch '4.0release' into merge/develop 2021-05-16 13:50:08 +08:00
winlin
edbb9cb238 Add FFmpeg LICENSE 2021-05-16 10:55:35 +08:00
hondaxiao
90f1b482ab SRT: Build SRT from source by SRS. 4.0.115 2021-05-16 08:23:26 +08:00
winlin
262f0fc8c8 SRT: Enable HTTP-FLV for SRT 2021-05-15 16:44:43 +08:00
winlin
3dce568b9c Rename SrsConsumer* to SrsLiveConsumer*. 4.0.114 2021-05-15 12:36:53 +08:00
winlin
dae6dc5395 Rename SrsRtcStream* to SrsRtcSource*. 4.0.113 2021-05-15 12:33:02 +08:00
winlin
2dd58665fa Rename SrsSource* to SrsLiveSource*. 4.0.112 2021-05-15 12:30:13 +08:00
winlin
9b6a1b16e1 RTC: Eliminate unused perf_stat 2021-05-15 12:04:21 +08:00
winlin
a1d7fe46c1 SquashSRS4: Rename SrsRtpPacket2 to SrsRtpPacket. 2021-05-15 08:53:54 +08:00
winlin
596686f7b7 Merge branch '4.0release' into merge/develop 2021-05-15 08:51:51 +08:00
winlin
61c808e153 Merge branch 'develop' into merge/develop 2021-05-15 08:51:46 +08:00
winlin
ddd7a378b1 Rename SrsRtpPacket2 to SrsRtpPacket. 4.0.111 2021-05-15 08:47:09 +08:00
winlin
6a980683f7 SquashSRS4: Remove object cache and stat api 2021-05-14 18:17:42 +08:00
winlin
a55686020f Merge 2021-05-14 18:16:30 +08:00
winlin
72a48f6115 Merge branch '4.0release' into merge/develop 2021-05-14 18:15:41 +08:00
winlin
ab0979a4ea RTC: Remove DTLS utests, cover by regression test 2021-05-14 18:14:00 +08:00
winlin
f7b32252b0 RTC: Remove Object Cache Pool, no effect. 4.0.110 2021-05-14 16:12:11 +08:00
winlin
d0951e2b43 Update RTSP issue link, deprecated 2021-05-14 11:42:29 +08:00
winlin
717e811002 Change virtual public to public. 4.0.109 2021-05-14 09:13:15 +08:00
winlin
53e20d4a37 RTC: Eliminate unused stat code 2021-05-14 09:06:12 +08:00
winlin
cd45750c9d RTC: Eliminate unused stat API 2021-05-14 08:56:41 +08:00
winlin
f711eb79ed SquashSRS4: Refine stat id. Fix SRT build bug 2021-05-14 08:26:07 +08:00
winlin
9fbfaf317e Merge branch '4.0release' into merge/develop 2021-05-14 08:25:06 +08:00
winlin
06f7d7d11b Refine id and vid for statistic. 4.0.108 2021-05-14 08:21:16 +08:00
winlin
393d976685 SquashSRS4: Fix memory leak 2021-05-13 22:32:29 +08:00
winlin
9cbdf29f7d SRT: Fix build fail bug, add ssl 2021-05-13 16:05:33 +08:00
winlin
47f3f4da5c SquashSRS4: fix bugs 2021-05-12 21:50:57 +08:00
winlin
2080d1b2b3 Merge 2021-05-12 21:49:24 +08:00
winlin
996c7d5697 SquashSRS3: Fix bug 2021-05-12 21:48:11 +08:00
winlin
eedfcf7fc2 Merge branch 'develop' into merge/develop 2021-05-12 21:47:29 +08:00
winlin
3939844301 SquashSRS4: Fix bugs 2021-05-11 19:12:15 +08:00
winlin
d4da7133e4 Merge branch '4.0release' into merge/develop 2021-05-11 19:11:03 +08:00
winlin
d6d15ae594 Merge branch 'develop' into merge/develop 2021-05-11 19:10:57 +08:00
winlin
8c5a435714 Fix print bug in retrieve_local_ips. 4.0.107 2021-05-11 19:04:43 +08:00
winlin
098e7b2716 Update benchmark data 2021-05-11 14:29:10 +08:00
winlin
76bf1a9c25 Update benchmark for RTMP 2021-05-11 12:27:51 +08:00
winlin
eb339432c4 SquashSRS4: Update benchmark data. 2021-05-10 18:09:59 +08:00
winlin
73f8d64215 Merge branch '4.0release' into merge/develop 2021-05-10 18:09:09 +08:00
winlin
e987866b19 Merge branch 'develop' into merge/develop 2021-05-10 18:09:05 +08:00
winlin
8cabaeeb38 RTC: Update benchmark data 2021-05-10 14:38:12 +08:00
winlin
6dc93fe0a8 RTC: Update benchmark data 2021-05-10 14:30:08 +08:00
winlin
3bf1b0cb7d Refine tid for sdk and demos. 4.0.106 2021-05-09 22:33:43 +08:00
winlin
8895d36746 SquashSRS4: Refine shared fast timer 2021-05-08 17:44:15 +08:00
winlin
b653326f7d Merge branch '4.0release' into merge/develop 2021-05-08 16:51:19 +08:00
winlin
fd3f7c7e2b Merge branch 'develop' into merge/develop 2021-05-08 16:51:15 +08:00
winlin
2ad24b2313 Refine shared fast timer. 4.0.105 2021-05-08 16:50:26 +08:00
winlin
3256c7c2fa SquashSRS4: Refine the init of global objects 2021-05-08 11:51:54 +08:00
winlin
6bab0eb8c8 Merge branch '4.0release' into merge/develop 2021-05-08 11:50:26 +08:00
winlin
f370259c9d Fix build fail 2021-05-08 11:42:50 +08:00
winlin
92d95a500f Merge branch '4.0release' into merge/develop 2021-05-08 11:32:51 +08:00
winlin
170ea8879d Merge branch 'develop' into merge/develop 2021-05-08 11:32:42 +08:00
winlin
4cf6da107c Refine init of global objects 2021-05-08 11:29:19 +08:00
winlin
8b58d18a5a Refine init of global objects 2021-05-08 11:25:48 +08:00
winlin
b1e85664a1 Refine init of global SrsPps 2021-05-08 11:11:13 +08:00
winlin
b6f2745822 Refine init of global variables 2021-05-08 10:25:04 +08:00
winlin
e8f7c913b0 Refine global or thread-local variables initialize. 4.0.104 2021-05-08 10:16:40 +08:00
winlin
276bd2223e SquashSRS4: Support circuit breaker 2021-05-08 10:04:44 +08:00
winlin
f98ec6b86c Merge 2021-05-08 10:02:47 +08:00
winlin
fa235a81aa Merge branch '4.0release' into merge/develop 2021-05-08 09:59:32 +08:00
winlin
e7cce88912 RTC: Refine timer stat 2021-05-07 19:01:25 +08:00
winlin
25f17c32e9 RTC: Refine fast timer 2021-05-07 18:42:36 +08:00
winlin
92fc0af8f4 RTC: Support circuit breaker. 4.0.103 2021-05-07 17:43:05 +08:00
winlin
fd6c653d3c SquashSRS4: Refine performance for FastTimer 2021-05-07 11:25:37 +08:00
winlin
f4704c2662 Merge 2021-05-07 10:58:34 +08:00
winlin
ee15d19878 Merge branch '4.0release' into merge/develop 2021-05-07 10:58:09 +08:00
winlin
46c980c70a RTC: Eliminate unused code 2021-05-07 10:57:25 +08:00
winlin
4527a91545 RTC: Refine play stream find track. 4.0.102 2021-05-07 10:50:51 +08:00
winlin
b823dcdfd7 RTC: Refine FastTimer to fixed interval. 4.0.101 2021-05-07 10:20:00 +08:00
winlin
f995bf7ca8 SquashSRS4: Transform config for nack/twcc. 2021-05-06 17:39:10 +08:00
winlin
019cdfd6ba Merge 2021-05-06 17:38:14 +08:00
winlin
bebc55439b Merge branch '4.0release' into merge/develop 2021-05-06 17:37:46 +08:00
winlin
0c0b467917 RTC: Transform config for nack/twcc. 4.0.100 2021-05-06 17:24:20 +08:00
winlin
f41c0b42b1 SquashSRS4: Fix config bug for nack and twcc. 2021-05-06 13:50:28 +08:00
winlin
1fe5ae04d3 Merge branch '4.0release' into merge/develop 2021-05-06 13:49:41 +08:00
winlin
c06b4838b8 Merge branch 'develop' into merge/develop 2021-05-06 13:49:34 +08:00
winlin
b41788ca4a RTC: Fix config bug for nack and twcc. 4.0.99 2021-05-06 11:42:42 +08:00
winlin
4f48ad7a8b RTC: Fix config check bug for nack and twcc 2021-05-06 11:41:11 +08:00
winlin
becbe45bcd SquashSRS4: Add demo for RTC 2021-05-05 13:26:25 +08:00
winlin
5317265b26 Merge 2021-05-05 13:24:56 +08:00
winlin
16162eccce Merge 2021-05-05 13:16:56 +08:00
winlin
320bff49e0 Update demos 2021-05-05 12:56:26 +08:00
winlin
37f051f16d Update console 2021-05-05 12:54:47 +08:00
winlin
1e27db6a7d Update players 2021-05-05 12:53:26 +08:00
winlin
a39ff09f2a Tools: Add wx-video brocasting for demo 2021-05-04 12:47:24 +08:00
winlin
5405494de8 Tools: Refine one to one RTC demo 2021-05-04 11:42:15 +08:00
winlin
6e26da2323 Tools: Refine sig sdk for demo 2021-05-04 11:27:18 +08:00
winlin
700186b1c8 Tools: Refine random room and display for demo 2021-05-04 11:20:10 +08:00
winlin
81a87d07f6 Add video room demo. 4.0.98 2021-05-04 10:48:02 +08:00
winlin
bfeca8e068 Tools: Add video room demo 2021-05-04 10:46:56 +08:00
winlin
b42bf496c7 Tools: Update script 2021-05-03 16:11:11 +08:00
winlin
9fb2b69212 Add RTC stream merging demo by FFmpeg. 4.0.97 2021-05-03 15:53:55 +08:00
winlin
aa9c4e8604 Tools: Refine one to one demo 2021-05-03 14:36:29 +08:00
winlin
ea417201b3 Tools: Copy to gits 2021-05-03 14:27:43 +08:00
winlin
74043b4153 Tools: Update one to one demo 2021-05-03 14:13:32 +08:00
winlin
fc23b9e5f5 Tools: Refine script 2021-05-03 10:06:56 +08:00
winlin
2783ac7c92 Tools: Sync 3rdparty tools 2021-05-03 10:05:45 +08:00
winlin
dea6136238 Copy demos to SRS release 2021-05-03 08:49:16 +08:00
winlin
206d95879f SquashSRS4: Add one to one RTC demo. 2021-05-02 21:46:41 +08:00
winlin
64243ddb8a Merge branch '4.0release' into merge/develop 2021-05-02 21:46:06 +08:00
winlin
63568380f3 Merge branch 'develop' into merge/develop 2021-05-02 21:46:01 +08:00
winlin
5e6fe49da1 Add one to one demo for no-localhost 2021-05-02 21:06:31 +08:00
winlin
5a611e0c4b Add one to one demo. 4.0.96 2021-05-02 19:35:03 +08:00
winlin
74bb47c13f SquashSRS4: Support RTC2RTMP. 2021-05-01 22:15:57 +08:00
winlin
2efeb33d14 Merge branch '4.0release' into merge/develop 2021-05-01 22:15:08 +08:00
winlin
1a7a508cc9 Merge 2021-05-01 22:15:01 +08:00
winlin
f7473c90bc For #2303: Add conf for RTC2RTMP 2021-05-01 18:19:17 +08:00
winlin
8a30cc86d9 Bridger: Fix build fail if disable rtc and ffmpeg-fit 2021-05-01 18:16:51 +08:00
winlin
3d225973ef Bridger: Support RTC2RTMP bridger and shared FastTimer. 4.0.95 2021-05-01 18:16:51 +08:00
winlin
c770e6d7bc Bridger: Start RTMP2RTC bridger in RTMP publisher 2021-05-01 18:16:51 +08:00
winlin
c10232b4e2 Bridger: Refine transcoder to support aac2opus and opus2aac. 4.0.94 2021-05-01 18:16:51 +08:00
winlin
00c192ede1 Timer: Apply shared FastTimer to RTC server. 4.0.93 2021-05-01 18:16:51 +08:00
winlin
8747dd6630 Timer: Extract shared FastTimer to use one timer for all connections 2021-05-01 18:16:51 +08:00
winlin
659e173e15 RTC: Refine for writing doc. 4.0.92 2021-05-01 16:42:09 +08:00
winlin
028808a76b Merge branch '4.0release' into merge/develop 2021-04-30 17:24:48 +08:00
winlin
f4f616d4e9 Update README 2021-04-30 17:22:39 +08:00
winlin
165f97e4a0 SquashSRS3: Link source flv in doc 2021-04-30 17:04:57 +08:00
winlin
0b62216999 SquashSRS4: Support av1 for Chrome M90 enabled it. 2021-04-30 08:13:38 +08:00
winlin
eda449d561 Merge branch 'develop' into merge/develop 2021-04-30 08:12:30 +08:00
winlin
3909e15fdf Merge branch '4.0release' into merge/develop 2021-04-30 08:12:26 +08:00
Winlin
e8fe66e3ba
RTC: Support av1 for Chrome M90 enabled it. 4.0.91 (#2324)
* RTC: Support av1 for Chrome M90 enabled it. 4.0.91

* RTC: Show codec for WebRTC publisher
2021-04-30 08:09:01 +08:00
winlin
a9d39f6946 RTC: Refine API params to create connection 2021-04-29 20:30:24 +08:00
winlin
51aa899358 RTC: Refine H5 demo, extract srs.sdk.js 2021-04-29 11:50:51 +08:00
winlin
a5727c373a Script: Remove unused git2unix.sh 2021-04-29 08:26:32 +08:00
winlin
84e649be8b SquashSRS4: Update gitee url 2021-04-28 17:19:24 +08:00
winlin
745c8f7a4a SquashSRS4: Update gitee url 2021-04-28 17:18:38 +08:00
winlin
b302d766e1 SquashSRS3: Update gitee url 2021-04-28 17:16:04 +08:00
winlin
b4b79179a7 SuqashSRS4: Update players 2021-04-28 15:52:28 +08:00
winlin
aee20d7d65 Merge branch 'develop' into merge/develop 2021-04-28 15:51:36 +08:00
winlin
e069b0e673 Merge 2021-04-28 15:51:03 +08:00
winlin
7cae97e4d3 SquashSRS3: Update players 2021-04-28 15:45:34 +08:00
winlin
dbd9741368 SquashSRS4: Update README 2021-04-28 12:28:19 +08:00
winlin
208c6f52fe Update 2021-04-28 12:26:38 +08:00
winlin
dee4fd404b Update README 2021-04-28 12:23:52 +08:00
winlin
ea1f32526a RTC: Remove DTLS utest, cover by regression test 2021-04-27 18:54:10 +08:00
winlin
a300d1fc54 Fix bug for alone pithy print 2021-04-27 18:34:51 +08:00
winlin
543377ebf1 Test: Update srs-bench 2021-04-27 17:40:47 +08:00
winlin
c2229d392a Add alone pithy print 2021-04-27 17:05:26 +08:00
winlin
e67207f4b1 Script: Refine package and install script 2021-04-26 14:20:18 +08:00
winlin
3d74b0efc9 SquashSRS4: Add crossdomain.xml for install script. 2021-04-26 13:59:29 +08:00
winlin
1fabe5137d Merge branch 'develop' into merge/develop 2021-04-26 13:58:59 +08:00
winlin
099b6c963d Merge branch '4.0release' into merge/develop 2021-04-26 13:58:55 +08:00
winlin
db37a4ac02 SquashSRS3: Add crossdomain.xml for install script. 2021-04-26 13:57:14 +08:00
winlin
f9d9f3a373 Modules: Fix build fail for global variables. 2021-04-25 13:34:57 +08:00
winlin
00a8eef580 Fix utest fail 2021-04-25 12:07:00 +08:00
winlin
d0fd0c4639 SquashSRS4: Update README 2021-04-25 08:59:26 +08:00
winlin
ddd9b23e4a Merge branch 'develop' into merge/develop 2021-04-25 08:58:55 +08:00
winlin
2584329a9c Merge branch '4.0release' into merge/develop 2021-04-25 08:58:51 +08:00
winlin
b5358d1cca SquashSRS3: Update README 2021-04-25 08:55:15 +08:00
winlin
fe1c3a4ce1 SquashSRS4: Update readme 2021-04-24 22:52:48 +08:00
winlin
b2e71ccfff Merge 2021-04-24 22:52:07 +08:00
winlin
d92fbafb20 SquashSRS3: Update readme 2021-04-24 22:45:55 +08:00
winlin
eba78149ad SquashSRS4: Change push-RTSP as deprecated feature. 2021-04-24 21:40:09 +08:00
winlin
76c9034f0b Merge 2021-04-24 21:39:37 +08:00
winlin
86f1a8b528 Merge branch '4.0release' into merge/develop 2021-04-24 21:38:48 +08:00
winlin
5516d3751f Change push-RTSP as deprecated feature. 2021-04-24 21:33:44 +08:00
winlin
d4a8a72388 SquashSRS4: Add console. Disable cherrypy by default. 2021-04-24 19:45:05 +08:00
winlin
f5c9996c59 Merge 2021-04-24 19:40:33 +08:00
winlin
6f66cf0868 Player: Change the default from RTMP to HTTP-FLV. 2021-04-24 19:38:49 +08:00
winlin
5232f9e043 Disable CherryPy by --cherrypy=off. 4.0.90 2021-04-24 19:26:24 +08:00
winlin
de1c7522f0 SquashSRS3: Add console 2021-04-24 19:07:37 +08:00
winlin
9ed7565789 SquashSRS3: Package srs-console 2021-04-24 17:51:05 +08:00
winlin
c95bfc4a46 Timer: Apply shared FastTimer to RTC server 2021-04-23 11:17:58 +08:00
winlin
7b413edbb7 Timer: Extract shared FastTimer to use one timer for all connections 2021-04-23 11:04:05 +08:00
winlin
7bdc9e8e96 Moduels: Refine the description 2021-04-21 11:18:35 +08:00
winlin
b29827d22c Modules: Enable app files for module 2021-04-21 11:03:37 +08:00
winlin
aa07f45545 SquashSRS4: Happy 2021 2021-04-20 19:03:02 +08:00
winlin
56446825dc Merge branch '4.0release' into merge/develop 2021-04-20 19:02:17 +08:00
winlin
49dffcd5d0 Merge branch 'develop' into merge/develop 2021-04-20 19:02:12 +08:00
winlin
cec0191b16 Happy 2021 2021-04-20 19:00:14 +08:00
winlin
6418ece694 SquashSRS4: Update description 2021-04-16 11:15:10 +08:00
winlin
9347329c42 Update 2021-04-16 11:14:32 +08:00
winlin
dc03f911ec Merge branch '4.0release' into merge/develop 2021-04-16 11:14:08 +08:00
winlin
23342363a7 SquashSRS3: Update description 2021-04-16 11:13:34 +08:00
winlin
c22fc75345 SquashSRS4: Update description 2021-04-16 11:10:36 +08:00
winlin
20f1a1a4f1 Merge branch 'develop' into merge/develop 2021-04-16 11:09:56 +08:00
winlin
9cd19a6e52 Merge branch '4.0release' into merge/develop 2021-04-16 11:09:51 +08:00
winlin
650fa0af0c SquashSRS3: Update description 2021-04-16 11:09:23 +08:00
winlin
8b74c7cb89 SquashSRS4: Happy 2021 2021-04-16 09:29:43 +08:00
winlin
b2be62a444 Merge branch 'develop' into merge/develop 2021-04-16 09:28:57 +08:00
winlin
2ea19a20dd Merge 4.0 2021-04-16 09:28:53 +08:00
winlin
124455be09 Update script 2021-04-16 09:27:47 +08:00
winlin
d01e603b25 Happy 2021 2021-04-16 09:25:55 +08:00
stone
3eb3cb9b51 For #2275, fix bug for transcode engine config param. 2021-04-09 07:22:15 +08:00
winlin
36743914ff Merge branch 'develop' into merge/develop 2021-04-09 07:21:28 +08:00
winlin
263ead07f0 Merge branch 'develop' into merge/develop 2021-04-09 07:20:57 +08:00
winlin
78af396c76 Merge branch '4.0release' into merge/develop 2021-04-09 07:20:53 +08:00
stone
6da91f7dea For #2275, fix bug for transcode engine config param. 2021-04-09 07:19:31 +08:00
winlin
323306149d SquashSRS4: Eliminate the dup code 2021-04-06 11:22:12 +08:00
winlin
a8fbae9e0a Merge 4.0 2021-04-06 11:21:15 +08:00
winlin
aae0f61165 RTC: Eliminate the dup code 2021-04-06 10:56:40 +08:00
winlin
55426c6331 SquashSRS4: Fix RTC connection dispose bug 2021-04-06 10:51:42 +08:00
winlin
6efa5b37e1 Merge branch '4.0release' into merge/develop 2021-04-06 10:50:57 +08:00
winlin
061f367a82 RTC: Fix RTC connection dispose bug 2021-04-06 10:50:23 +08:00
winlin
4871c616b8 Update README 2021-04-05 12:47:21 +08:00
winlin
1ee77614fb Refine comments 2021-04-05 12:14:26 +08:00
winlin
237c1e4d3d SquashSRS4: Fix DTLS warnings for HTTP api 2021-04-05 08:29:29 +08:00
winlin
f40658ae35 Merge branch 'develop' into merge/develop 2021-04-05 08:28:55 +08:00
winlin
79a357a945 Merge branch '4.0release' into merge/develop 2021-04-05 08:28:48 +08:00
winlin
db7e820f04 RTC: Fix DTLS warnings for HTTP api 2021-04-05 08:28:16 +08:00
winlin
fcf72b48f9 SquashSRS4: Fix republish bug 2021-04-04 19:05:44 +08:00
winlin
30b1fa650c Merge 2021-04-04 19:05:10 +08:00
winlin
ee978c319a Merge branch '4.0release' into merge/develop 2021-04-04 19:04:43 +08:00
winlin
96003d4a52 RTC: Fix bug for republish stream. 4.0.89 2021-04-04 19:01:42 +08:00
winlin
52644f50c9 SquashSRS4: Fix republish bug 2021-04-04 18:50:59 +08:00
winlin
ff2b02f38b Merge branch 'develop' into merge/develop 2021-04-04 18:50:05 +08:00
winlin
bae7484d53 Merge branch '4.0release' into merge/develop 2021-04-04 18:48:48 +08:00
winlin
8d9dd532b9 RTC: Fix bug for republish stream. 4.0.89 2021-04-04 18:35:02 +08:00
winlin
d80ba9d284 SquashSRS4: Fix memory leak 2021-04-01 17:35:40 +08:00
winlin
71388c1af6 Merge branch 'develop' into merge/develop 2021-04-01 17:35:15 +08:00
winlin
d455e594b9 Merge branch '4.0release' into merge/develop 2021-04-01 17:35:06 +08:00
winlin
3c59fedab6 RTC: Fix memory leak 2021-04-01 17:34:47 +08:00
winlin
fa2fec3247 SquashSRS4: Refine payload NALU type parser 2021-04-01 14:48:41 +08:00
winlin
681ea04c8c Merge branch 'develop' into merge/develop 2021-04-01 14:48:07 +08:00
winlin
cc1cab2803 Merge branch '4.0release' into merge/develop 2021-04-01 14:47:48 +08:00
winlin
7823d75a38 RTC: Refine payload NALU type parser 2021-04-01 14:46:28 +08:00
winlin
0cc3063703 SquashSRS4: Refine TWCC and SDP exchange. 4.0.88 2021-04-01 10:55:03 +08:00
winlin
c626922ba4 Merge branch 'develop' into merge/develop 2021-04-01 10:53:59 +08:00
winlin
bf7118df27 SquashSRS4: Refine TWCC and SDP exchange. 4.0.88 2021-04-01 10:53:44 +08:00
winlin
aa5d872b8c RTC: Refine TWCC and SDP exchange. 4.0.88 2021-04-01 10:50:20 +08:00
winlin
bd1752a4b2 RTC: Fix TWCC send bug 2021-04-01 10:47:50 +08:00
winlin
7ac4a4f4ca RTC: Fix audio track description bug 2021-04-01 10:24:37 +08:00
winlin
f4b791a9d5 Kernel: Never assert for SrsBuffer::require 2021-04-01 10:22:07 +08:00
winlin
4d5c7e0a73 RTC: Fix object cache bug, reset payload when recycle 2021-04-01 10:21:19 +08:00
winlin
45b83bd22e SquashSRS4: Update comments and performance data 2021-03-31 18:25:12 +08:00
winlin
30c007f059 Merge branch 'develop' into merge/develop 2021-03-31 18:24:14 +08:00
winlin
ae0871d696 Merge branch '4.0release' into merge/develop 2021-03-31 18:24:10 +08:00
winlin
3d4d250eb9 RTC: Update performance data 2021-03-31 18:22:28 +08:00
winlin
f2d0c34244 RTC: Refine comments for SrsRtpPacket2 2021-03-31 17:46:45 +08:00
winlin
4692e8b8ad SquashSRS4: Support WebRTC re-publish stream. 2021-03-26 14:59:25 +08:00
winlin
6aed86f852 Merge branch '4.0release' into merge/develop 2021-03-26 14:58:30 +08:00
winlin
f8fba5fe4e Merge branch 'develop' into merge/develop 2021-03-26 14:58:24 +08:00
winlin
d6c16a7e23 RTC: Support WebRTC re-publish stream. 4.0.87 2021-03-24 20:12:31 +08:00
winlin
aab54b2cf4 SquashSRS4: Refine RTC extension ID parsing 2021-03-24 19:00:42 +08:00
winlin
10c6e7dc98 Merge branch '4.0release' into merge/develop 2021-03-24 19:00:08 +08:00
winlin
dfc236eee7 Merge branch 'develop' into merge/develop 2021-03-24 19:00:04 +08:00
winlin
0cb05a2953 RTC: Refine ID parsing 2021-03-24 18:58:01 +08:00
winlin
ff268dca23 SquashSRS4: Eliminate dead code, we never offer 2021-03-24 15:27:07 +08:00
winlin
0aef74ea7a Merge 4.0release 2021-03-24 15:25:49 +08:00
winlin
89f941fadc Refine version file 2021-03-24 15:24:21 +08:00
winlin
6c7e24fc6d RTC: Eliminate dead code, we nerver send offer 2021-03-24 15:21:40 +08:00
winlin
ecd4527342 SquashSRS4: Use fast parse TWCCID, ignore in packet parsing 2021-03-24 14:17:52 +08:00
winlin
875201b161 Merge 4.0release 2021-03-24 14:16:31 +08:00
winlin
4c39cc7c2f RTC: Use fast parse TWCCID, ignore in packet parsing. 4.0.86
1. TWCC should not be passed from end to end.
2. Publisher TWCC information, should be ignore when pass to player
3. Player should regenerate its own TWCC.
2021-03-24 12:29:17 +08:00
winlin
67c5f8ad7e Refine code 2021-03-24 11:07:03 +08:00
winlin
63a276f6cf Merge branch 'develop' into merge/develop 2021-03-24 11:06:03 +08:00
winlin
b7b474deba SquashSRS4: Update srs-bench. 2021-03-24 11:05:25 +08:00
winlin
07265d8d73 Merge 4.0release 2021-03-24 11:03:21 +08:00
winlin
719fc7cf85 Merge branch 'develop' into merge/develop 2021-03-24 11:01:19 +08:00
winlin
f5ff28d47a RTC: Refine play stream init 2021-03-24 10:50:13 +08:00
winlin
3fea5c0ec3 Test: Add republish regression test, should fail 2021-03-23 19:32:59 +08:00
winlin
bb37a5550c Test: Update srs-bench 2021-03-23 12:12:01 +08:00
winlin
25145b945d RTC: Use send_rtcp to encrypt and send RTCP bytes 2021-03-22 16:25:08 +08:00
winlin
4329c7e7cb Live: Refine edge to follow client and HTTP/302. 5.0.1 2021-03-17 16:58:40 +08:00
winlin
4f1d213c91 Live: Support follow HTTP/302 for HTTP/HTTPS FLV edge. 2021-03-17 16:53:39 +08:00
winlin
35431749c4 Live: Support follow client protocol for edge. 2021-03-17 16:48:18 +08:00
winlin
33fa43c118 Init SRS/5. 5.0.0 2021-03-15 14:11:34 +08:00
winlin
cfc2fb33c8 Merge branch '4.0release' into merge/develop 2021-03-15 14:05:29 +08:00
winlin
e54e45db97 Merge branch 'develop' into merge/develop 2021-03-15 14:05:19 +08:00
winlin
42c5a935f9 Update README 2021-03-15 14:03:20 +08:00
winlin
c193331648 Update README 2021-03-15 13:45:06 +08:00
winlin
ccbc11c2d6 Test: Fix bug for srs-bench. 2021-03-12 13:10:10 +08:00
winlin
c07b7db3c5 Test: Update srs-bench. 2021-03-12 13:08:46 +08:00
winlin
57f8a1afec Update doc. 2021-03-11 17:15:33 +08:00
winlin
74de9fd93b Merge branch '4.0release' into merge/develop 2021-03-11 17:14:31 +08:00
winlin
a3dbb22696 Fix bugs. 4.0.85 2021-03-11 17:12:44 +08:00
winlin
dc1606230f Merge branch '4.0release' into merge/develop 2021-03-11 17:09:45 +08:00
winlin
ad7576b05d Update CI and CodeCov status in README.md 2021-03-11 17:08:10 +08:00
winlin
4f1aa924e6 SquashSRS4: Add security scan. Feed TWCC before drop PT. 2021-03-11 16:55:05 +08:00
winlin
7f48d9fceb Merge branch '4.0release' into merge/develop 2021-03-11 16:53:16 +08:00
winlin
a53fe451ff RTC: Feed TWCC then drop the specified PT packet.
1. Sometimes we might drop RTP packets, by PT(payload type).
2. For example, the padding packets from client.
3. We should feed these packets to TWCC, then drop it.
2021-03-11 16:48:29 +08:00
winlin
197fe10310 Security: Support CodeQL analysis 2021-03-11 12:33:01 +08:00
winlin
d53b5b3f2e Security: Support CodeQL analysis 2021-03-11 12:31:15 +08:00
winlin
7f8df6f21f Build: Refine script for SRTP.
Because we have upgraded to openssl-1.1.1d and libsrtp-2.3,
so it's able to enable ASM for SRTP for not only openssl-1.0,
because libsrtp-2.3 fixed the capacity bug.
2021-03-11 08:16:25 +08:00
winlin
99c0481c03 Merge branch 'develop' into merge/develop 2021-03-10 11:44:30 +08:00
winlin
e74810230a SquashSRS4: Regine DTLS and add regression tests. 4.0.84 2021-03-10 08:29:40 +08:00
winlin
7b0e6fbae8 Merge branch '4.0release' into merge/develop 2021-03-10 08:27:37 +08:00
winlin
fc7aff8c75 Merge branch 'develop' into merge/develop 2021-03-10 08:27:31 +08:00
winlin
f066914968 Test: Add missing files. 2021-03-10 07:38:11 +08:00
winlin
27d4080084 Test: Fix check file bug 2021-03-10 07:26:18 +08:00
winlin
030b94e717 Test: Add missing files for srs-bench 2021-03-10 07:03:57 +08:00
winlin
06f2e1462e DTLS: Update regression tests 2021-03-09 22:26:50 +08:00
winlin
d4d11c2c18 DTLS: Change max loop to larger 2021-03-09 22:19:32 +08:00
winlin
62987aa01f DTLS: Refine retransmit between ClientHello and Certificate. 2021-03-09 22:12:23 +08:00
winlin
02aac0fea4 DTLS: Fix ARQ bug, use openssl timeout. 4.0.84 2021-03-09 19:36:45 +08:00
winlin
dc93836489 SquashSRS4: Refine DTLS init, use specified API by role 2021-03-09 12:01:23 +08:00
winlin
9280a8b478 Merge branch '4.0release' into merge/develop 2021-03-09 12:00:17 +08:00
winlin
3c6e466280 DTLS: Use specified init API, to decrease packet size 2021-03-09 11:54:27 +08:00
winlin
3a5d88b435 DTLS: Disable QueryMTU for openssl, or the packet get fragmented 2021-03-09 07:22:11 +08:00
winlin
079c54bbe7 Add important comment for ST 2021-03-09 07:21:07 +08:00
winlin
55bdc354f5 Add important comment for disposing and thread stop 2021-03-08 21:05:02 +08:00
winlin
de65a331f1 SquashSRS4: Fix DTLS config bug, dup Alert bug. 4.0.83 2021-03-08 12:39:25 +08:00
winlin
e077ba14c8 Merge branch 'develop' into merge/develop 2021-03-08 12:37:28 +08:00
winlin
7ee83106c1 Merge branch '4.0release' into merge/develop 2021-03-08 12:37:03 +08:00
winlin
e4df2eb2ce DTLS: Fix dead loop by duplicated Alert message. 4.0.83 2021-03-08 12:35:16 +08:00
winlin
1ed567a005 DTLS: Fix dead loop by duplicated Alert message 2021-03-08 12:34:15 +08:00
winlin
43028c99c8 Fix bug when client DTLS is passive. 4.0.82 2021-03-08 10:41:42 +08:00
winlin
fe1b427462 Update 2021-03-06 10:46:07 +08:00
winlin
fc4f539907 Should check bridger status when publish stream. 2021-03-05 16:47:47 +08:00
winlin
c3f057e4d3 Squash SRS4: Update README for docker 2021-03-05 10:04:18 +08:00
winlin
e26ea28d53 Merge branch '4.0release' into merge/develop 2021-03-05 10:02:49 +08:00
winlin
c143b6bfd0 Squash SRS3: Update README for docker 2021-03-05 09:53:15 +08:00
winlin
f80a52f265 Update README for docker 2021-03-05 07:58:32 +08:00
winlin
25ded715a5 Merge branch 'develop' into merge/develop 2021-03-04 23:06:59 +08:00
winlin
56b64689bf SquashSRS4: Docker: Add conf/docker.conf, daemon off, log console, enable RTC 2021-03-04 23:06:08 +08:00
winlin
bbbcd4cd34 Merge branch '4.0release' into merge/develop 2021-03-04 23:02:21 +08:00
winlin
83c615aa8a SquashSRS3: Docker: Add conf/docker.conf, daemon off, log console, enable RTC 2021-03-04 22:45:43 +08:00
winlin
741b2ebf50 Merge branch '4.0release' into develop 2021-03-04 17:13:25 +08:00
winlin
817c704db7 SquashSRS4: Support fast local coverage with module 2021-03-04 17:13:24 +08:00
winlin
990dc8cda9 Script: Fast coverage support module filter 2021-03-04 17:10:12 +08:00
winlin
d6a6f98a70 Script: Support local fast coverage by gcovr 2021-03-04 17:10:12 +08:00
winlin
7d12c3641a Merge ST, support utest and coverage by gtest. 2021-03-04 15:01:14 +08:00
winlin
3bb1b673c5 Merge SRS4, lots of features 2021-03-04 14:49:03 +08:00
winlin
bb3bd1705e Refine the regression test tool, add missing files 2021-03-04 14:19:39 +08:00
winlin
a29d0a6a24 Add CI for CentOS7, C++98(ANSI) and no FFmpeg-fit 2021-03-04 14:18:59 +08:00
winlin
876210f6c9 For regression test, add srs-bench to 3rdparty 2021-03-04 14:18:57 +08:00
winlin
de87dd427d Fix utest fail 2021-03-04 14:18:54 +08:00
winlin
5a66d15e85 Support regression test in CI. 2021-03-04 14:18:52 +08:00
winlin
212ff6fc2d Never force to openssl-1.0 for asm and srtp-asm, because openssl-1.1+libsrtp-2.3 is ok now 2021-03-04 14:18:50 +08:00
winlin
868899165f CI: Add centos8 and ubuntu20 to CI 2021-03-04 14:18:47 +08:00
Pieere Pi
4ba485002c Fix #2106, #2011, RTMP/AAC transcode to Opus bug. 4.0.81 2021-03-04 14:17:36 +08:00
winlin
dd8f7ff09a Enable HTTP-FLV for conf/rtc.conf 2021-03-04 14:16:03 +08:00
winlin
eaeacab920 Update README 2021-03-04 14:16:00 +08:00
winlin
e2b7795664 Update README 2021-03-04 14:15:57 +08:00
winlin
0bc3bdc7b8 Refine gcov files 2021-03-04 14:15:52 +08:00
winlin
27712fdda7 Rename ffmpeg-4.2-fit to ffmpeg-4-fit 2021-03-04 14:14:06 +08:00
winlin
b19074721c Refine build script 2021-03-04 14:14:01 +08:00
winlin
8089fc004c Upgrade libsrtp from 2.0.0 to 2.3.0, with source code. 4.0.79 2021-03-04 14:13:58 +08:00
winlin
3749d4d833 Update doc 2021-03-04 14:13:56 +08:00
winlin
921e4041ba Update doc 2021-03-04 14:13:52 +08:00
winlin
c9d68aae79 Refine FFmpeg-4.2-fit build bug 2021-03-04 14:13:45 +08:00
winlin
812d4ebfea Refine FFmpeg-4.2-fit build, copy source code 2021-03-04 14:13:43 +08:00
winlin
98839d3d53 RTC: Fix TWCC enable bug 2021-03-04 14:13:40 +08:00
winlin
96dbd7bced Upgrade openssl from 1.1.0e to 1.1.1b, with source code. 4.0.78 2021-03-04 14:12:47 +08:00
winlin
8f1c992379 Refine code, rename drop to loss 2021-03-04 14:12:39 +08:00
winlin
d4b8a57cf7 Enable Object Cache and Zero Copy Nack by default. 4.0.77 2021-03-04 14:12:31 +08:00
winlin
f4331be2ef For #2219, Remove ubuntu20 CI 2021-03-03 22:09:24 +08:00
winlin
7187636101 Fix #2219, Refine CI for ubuntu20 2021-03-03 21:59:06 +08:00
winlin
feca8f2578 Fix #2219, Refine CI for ubuntu20 2021-03-03 21:39:17 +08:00
winlin
6b2eb43e5c Fix #2219, Refine CI for ubuntu20 2021-03-03 21:37:15 +08:00
winlin
57f16299f4 Fix #2219, Ubuntu build fail. Add CI for ubuntu20 2021-03-03 21:15:26 +08:00
winlin
969b947849 Hotfix 4.0.76, fix build fail for FFmpeg-fit CentOS6 2021-03-02 20:51:31 +08:00
winlin
eaf9ec6de8 Update README 2021-03-02 19:35:05 +08:00
winlin
781cd8e9de Update README 2021-03-02 19:35:02 +08:00
winlin
58924d41b1 RTC: Support high performance NO-COPY-NACK. 4.0.76 2021-03-02 19:34:59 +08:00
winlin
f63441413d RTC: Support disable the NACK no-copy, enable copy by default 2021-03-02 19:34:56 +08:00
winlin
50860325dd RTC: Fix copy RTP packet bug 2021-03-02 19:34:53 +08:00
winlin
2719e4c0be Refine code 2021-03-02 19:34:50 +08:00
winlin
ee9ef378f9 RTC: Fix bug for wrap exists buffer size 2021-03-02 19:34:46 +08:00
winlin
b91d37b78a RTC: Store the actual size of buffer for RTP packet. 2021-03-02 19:34:39 +08:00
winlin
171ae5dd2d RTC: Fix shared msg cache bug 2021-03-02 19:34:37 +08:00
winlin
eed98dd85b RTC: Refine code, remove the reset for header 2021-03-02 19:34:35 +08:00
winlin
5d4baf4eca RTC: Refine code, remove the assign 2021-03-02 19:34:33 +08:00
winlin
7c517988a6 Perf: Refine header extensions marshal 2021-03-02 19:34:31 +08:00
winlin
eb9a263433 Cache RTP packet size, revert 9ee0ed919a 2021-03-02 19:34:18 +08:00
winlin
11454b3ced Perf: Avoid RTP packet copy for player NACK. 2021-03-02 19:34:12 +08:00
winlin
51a5e283fc Perf: Avoid RTP packet copy for publisher NACK. 2021-03-02 19:34:10 +08:00
winlin
74f63d6b14 RTC: Ignore NACK when disable for player. 2021-03-02 19:34:08 +08:00
winlin
0aeaf442f7 RTC: Ignore NACK when disable for player. 2021-03-02 19:34:04 +08:00
winlin
f831e9240e RTC: Fast copy shared message for RTP 2021-03-02 19:34:01 +08:00
winlin
42223b3f2e RTC: No cache for RTP packet size. 2021-03-02 19:33:59 +08:00
winlin
3728b07c49 Perf: Refine RTP packet copy 2021-03-02 19:33:56 +08:00
winlin
033f341ce1 Perf: Refine the recycle RTP packet, user should reset it 2021-03-02 19:33:49 +08:00
winlin
b1457dfc16 Perf: Refine copy RTP header. 2021-03-02 19:33:46 +08:00
winlin
81dddcbd93 RTC: Remove dead code 2021-03-02 19:33:44 +08:00
winlin
00b0e22402 Refine code 2021-03-02 19:33:42 +08:00
winlin
cca5f8db82 Refine code 2021-03-02 19:33:40 +08:00
winlin
6d64490d73 Perf: Never reset the csrc 2021-03-02 19:33:39 +08:00
winlin
0fa3646c4a Perf: Directly reference the extmap 2021-03-02 19:33:37 +08:00
winlin
e441702246 Refine code 2021-03-02 19:33:35 +08:00
winlin
e2bf9f3623 Refine code, remove goto 2021-03-02 19:33:34 +08:00
winlin
ecef3e7f0a Perf: Refine player cycle, use fast coroutine 2021-03-02 19:33:32 +08:00
winlin
29b33e6303 RTC: Disable player perf stat, because it should be refined. 2021-03-02 19:33:29 +08:00
winlin
561acd26c5 Refine code 2021-03-02 19:33:27 +08:00
winlin
db0090be05 Refine code 2021-03-02 19:33:25 +08:00
winlin
aacdc21d1c Refine object cache. 2021-03-02 19:33:23 +08:00
winlin
1e2daf9ea3 Refine comments for object cache 2021-03-02 19:33:19 +08:00
winlin
6656330d2a Perf: Use vector to replace list for object cache 2021-03-02 19:33:17 +08:00
winlin
f2d9eb345c Perf: Refine object cache, avoid dynamic cast 2021-03-02 19:33:15 +08:00
winlin
8d7a201742 RTC: Remove unused config 2021-03-02 19:33:12 +08:00
winlin
73e357a93f RTC: Support object cache pool. 4.0.75 2021-03-02 19:33:07 +08:00
winlin
8e4f252686 Support reload the object cache pool 2021-03-02 19:32:59 +08:00
winlin
501104e728 Perf: Limit the size of object cache pool 2021-03-02 19:32:56 +08:00
winlin
3989f2d553 RTC: Refine the stat logs, limit the object cache pool 2021-03-02 19:32:52 +08:00
winlin
30d760f909 RTC: Only cache the UDP packet message 2021-03-02 19:32:49 +08:00
winlin
c00d286344 Perf: Refine the stat 2021-03-02 19:32:47 +08:00
winlin
919107c674 Perf: Stat the shared messages. 2021-03-02 19:32:44 +08:00
winlin
fc4d7080c6 RTC: Cache the RTP payload objects 2021-03-02 19:32:42 +08:00
winlin
4d0863468a RTC: Cache the large buffer allocation 2021-03-02 19:32:40 +08:00
winlin
6e9cb059b3 RTC: Stat the large buffer allocation 2021-03-02 19:32:37 +08:00
winlin
4cb3a18d1e RTC: Apply RTP packet cache manager 2021-03-02 19:32:34 +08:00
winlin
86f43d4f72 RTC: Support RTP packet cache manager 2021-03-02 19:32:32 +08:00
winlin
bde86a2b23 RTC: Refine RTP packet buffer allocate, align to about 1500 bytes 2021-03-02 19:32:29 +08:00
winlin
b2d546156e RTC: Refine RTP packet api, keep shared message to private 2021-03-02 19:32:25 +08:00
winlin
0cb125e53d RTC: Refine publisher memory allocate, by packet itself 2021-03-02 19:32:16 +08:00
winlin
81060a17e6 Build: Add gcc version in cache directory 2021-03-02 19:31:53 +08:00
winlin
cec588e08a For #2188: Remove sendmmsg from ST. 2021-03-02 19:31:33 +08:00
winlin
d7bc8b98fb Fix build warning 2021-03-02 19:31:29 +08:00
winlin
048a72ab6e RTC: Refine memory allocate for publisher 2021-03-02 19:31:15 +08:00
winlin
23fa3fb350 RTC: Refine memory allocate for publisher 2021-03-02 19:31:12 +08:00
winlin
4aa82b2fbf RTC: Refine memory copy, allocate it later 2021-03-02 19:31:06 +08:00
winlin
edb8a0f497 RTC: Cache the buffer for player 2021-03-02 19:31:04 +08:00
winlin
e7529ce9dc RTC: Stat the RTP and payload objects 2021-03-02 19:31:01 +08:00
winlin
6dac180627 Kernel: Never depends on another globals for global variables 2021-03-02 19:30:56 +08:00
winlin
d8ba72fdc5 Kernel: Extract SrsPps to kernel 2021-03-02 19:30:52 +08:00
winlin
df6e47ebfc RTC: Refine stat for RTC server 2021-03-02 19:30:49 +08:00
winlin
5ff9977572 Perf: Improve fast find for pithy print 2021-03-02 19:30:46 +08:00
winlin
9ab12f9f2f RTC: Stat the drop of UDP packets. 2021-03-02 19:30:40 +08:00
winlin
b9352eac0c RTC: Refine stat logs 2021-03-02 19:30:36 +08:00
winlin
09bd1b9faa RTC Stat the detail of send packets 2021-03-02 19:30:35 +08:00
winlin
d92ceaca39 RTC: Stat the detail of received packets 2021-03-02 19:30:33 +08:00
winlin
6c24f2e353 Refine logs 2021-03-02 19:30:29 +08:00
winlin
2f1e8a6911 RTC: Refine logs 2021-03-02 19:30:26 +08:00
winlin
33f4e02072 RTC: Send NACK one by one to avoid packet freed by context switching 2021-03-02 19:30:18 +08:00
winlin
e1a840772d RTC: Refine TWCC and RTCP timer to 100ms. 2021-03-02 19:30:08 +08:00
winlin
7c2cc4f2f7 Update README 2021-02-28 22:02:24 +08:00
winlin
519a3eba78 Update README 2021-02-28 21:58:39 +08:00
winlin
36ea67359e RTC: Support high performance NO-COPY-NACK. 4.0.76 2021-02-28 20:27:34 +08:00
winlin
c20d8fb617 RTC: Support disable the NACK no-copy, enable copy by default 2021-02-28 18:51:27 +08:00
winlin
44aa976976 RTC: Fix copy RTP packet bug 2021-02-28 18:22:04 +08:00
winlin
2b4b6a8e65 Refine code 2021-02-28 17:47:35 +08:00
winlin
563b99701a RTC: Fix bug for wrap exists buffer size 2021-02-28 17:36:03 +08:00
winlin
8c94faf693 RTC: Store the actual size of buffer for RTP packet. 2021-02-28 17:26:08 +08:00
winlin
f6589aa370 RTC: Fix shared msg cache bug 2021-02-28 11:26:50 +08:00
winlin
75a4c8d9e5 RTC: Refine code, remove the reset for header 2021-02-28 10:06:52 +08:00
winlin
5af0bf9350 RTC: Refine code, remove the assign 2021-02-28 10:04:30 +08:00
winlin
515e4f135b Perf: Refine header extensions marshal 2021-02-28 09:51:28 +08:00
winlin
314a6dbec6 Cache RTP packet size, revert 9ee0ed919a 2021-02-28 08:23:35 +08:00
winlin
af0b50f54c Perf: Avoid RTP packet copy for player NACK. 2021-02-28 08:07:06 +08:00
winlin
8382f570dd Perf: Avoid RTP packet copy for publisher NACK. 2021-02-28 07:27:14 +08:00
winlin
3e5731d700 RTC: Ignore NACK when disable for player. 2021-02-28 07:09:27 +08:00
winlin
712dc7225a RTC: Ignore NACK when disable for player. 2021-02-28 06:56:53 +08:00
winlin
4e474a24ce RTC: Fast copy shared message for RTP 2021-02-27 23:29:52 +08:00
winlin
9ee0ed919a RTC: No cache for RTP packet size. 2021-02-27 23:10:46 +08:00
winlin
4058249d67 Perf: Refine RTP packet copy 2021-02-27 23:03:08 +08:00
winlin
8de201b635 Perf: Refine the recycle RTP packet, user should reset it 2021-02-27 22:09:06 +08:00
winlin
b71cafea58 Perf: Refine copy RTP header. 2021-02-27 22:00:00 +08:00
winlin
831a1b146f RTC: Remove dead code 2021-02-27 21:46:50 +08:00
winlin
3f36397f98 Refine code 2021-02-27 20:05:28 +08:00
winlin
f9f39234b2 Refine code 2021-02-27 19:55:57 +08:00
winlin
a254bb1817 Perf: Never reset the csrc 2021-02-27 19:49:44 +08:00
winlin
c7c0b32e56 Perf: Directly reference the extmap 2021-02-27 19:41:16 +08:00
winlin
55696ce871 Refine code 2021-02-27 18:39:09 +08:00
winlin
f83a47a0fc Refine code, remove goto 2021-02-27 17:53:59 +08:00
winlin
f4f85a98d2 Perf: Refine player cycle, use fast coroutine 2021-02-27 17:40:19 +08:00
winlin
ab601ff386 RTC: Disable player perf stat, because it should be refined. 2021-02-27 12:54:06 +08:00
winlin
f689b74cc7 Refine code 2021-02-27 12:34:12 +08:00
winlin
7c6f56affa Refine code 2021-02-27 12:33:33 +08:00
winlin
edbabf840d Refine object cache. 2021-02-27 12:32:46 +08:00
winlin
2ec03bf56a Refine comments for object cache 2021-02-27 12:14:48 +08:00
winlin
50e331ff28 Perf: Use vector to replace list for object cache 2021-02-27 11:40:46 +08:00
winlin
471cf611c6 Perf: Refine object cache, avoid dynamic cast 2021-02-27 11:23:50 +08:00
winlin
427e3e0d84 RTC: Remove unused config 2021-02-27 10:41:48 +08:00
winlin
14bfc98122 RTC: Support object cache pool. 4.0.75 2021-02-27 09:18:02 +08:00
winlin
36f55247a3 Support reload the object cache pool 2021-02-27 08:21:04 +08:00
winlin
a29d6cba68 Perf: Limit the size of object cache pool 2021-02-27 08:18:08 +08:00
winlin
7b3b7381e2 RTC: Refine the stat logs, limit the object cache pool 2021-02-27 07:41:51 +08:00
winlin
30809aee60 RTC: Only cache the UDP packet message 2021-02-26 22:55:27 +08:00
winlin
e79293a3bc Perf: Refine the stat 2021-02-26 21:35:51 +08:00
winlin
d6c0117870 Perf: Stat the shared messages. 2021-02-26 20:38:50 +08:00
winlin
bffe9c5f4b RTC: Cache the RTP payload objects 2021-02-26 20:28:05 +08:00
winlin
d5b210abc8 RTC: Cache the large buffer allocation 2021-02-26 19:46:52 +08:00
winlin
65ba88de3f RTC: Stat the large buffer allocation 2021-02-26 18:32:49 +08:00
winlin
439a7fa655 RTC: Apply RTP packet cache manager 2021-02-26 16:36:21 +08:00
winlin
1833780655 RTC: Support RTP packet cache manager 2021-02-26 16:21:59 +08:00
winlin
d7f4de6696 RTC: Refine RTP packet buffer allocate, align to about 1500 bytes 2021-02-26 13:11:56 +08:00
winlin
58d71c23bc RTC: Refine RTP packet api, keep shared message to private 2021-02-26 12:25:35 +08:00
winlin
2ae7e22469 RTC: Refine publisher memory allocate, by packet itself 2021-02-26 11:18:15 +08:00
winlin
001a6a33ce Build: Add gcc version in cache directory 2021-02-26 10:20:22 +08:00
winlin
34dae0fe0d For #2188: Remove sendmmsg from ST. 2021-02-26 09:13:21 +08:00
winlin
20374ea59f Fix build warning 2021-02-26 07:05:20 +08:00
winlin
0cd3e34900 RTC: Refine memory allocate for publisher 2021-02-25 19:16:50 +08:00
winlin
8bdf71bb7c RTC: Refine memory allocate for publisher 2021-02-25 19:15:34 +08:00
winlin
ccb24a13ad RTC: Refine memory copy, allocate it later 2021-02-25 19:02:38 +08:00
winlin
2f4fe31337 RTC: Cache the buffer for player 2021-02-25 17:56:15 +08:00
winlin
8baf0867a0 RTC: Stat the RTP and payload objects 2021-02-25 14:25:54 +08:00
winlin
1909cfb3ff Kernel: Never depends on another globals for global variables 2021-02-25 14:06:18 +08:00
winlin
20df644a05 Kernel: Extract SrsPps to kernel 2021-02-25 13:46:52 +08:00
winlin
7b7a225631 RTC: Refine stat for RTC server 2021-02-25 12:32:58 +08:00
winlin
adfca6069c Perf: Improve fast find for pithy print 2021-02-24 20:56:17 +08:00
winlin
3a7c742f07 RTC: Stat the drop of UDP packets. 2021-02-24 18:53:49 +08:00
winlin
243100817a RTC: Refine stat logs 2021-02-24 18:39:07 +08:00
winlin
3c1738b60e RTC Stat the detail of send packets 2021-02-24 17:55:27 +08:00
winlin
749a7eafef RTC: Stat the detail of received packets 2021-02-24 17:33:20 +08:00
winlin
e06d6672d5 Refine logs 2021-02-24 17:22:49 +08:00
winlin
e0eb4e2d51 RTC: Refine logs 2021-02-24 11:39:30 +08:00
winlin
0efb787f36 RTC: Send NACK one by one to avoid packet freed by context switching 2021-02-23 17:10:27 +08:00
winlin
d4aead59d4 RTC: Refine TWCC and RTCP timer to 100ms. 2021-02-19 20:25:17 +08:00
winlin
9e0120dfcd Merge branch '4.0release' into develop 2021-02-19 19:18:31 +08:00
winlin
6d3aa2c426 Refine code. 4.0.74 2021-02-19 19:17:29 +08:00
winlin
af746ed000 Merge SRS 4.0 2021-02-19 19:14:41 +08:00
winlin
3a83a74dfc Stat: Refine stat bug for timer 2021-02-19 19:12:40 +08:00
winlin
5b8eea8cc5 Stat: Fix build fail for stat of timer and dispose 2021-02-19 19:08:16 +08:00
winlin
9c1d6ae654 Merge SRS 4.0 2021-02-19 18:56:47 +08:00
winlin
941a9aaf7a Refine timer, 4.0.73 2021-02-19 18:55:24 +08:00
winlin
6bacccd1b8 Fix utest fail 2021-02-19 18:54:16 +08:00
xialixin@kanzhun.com
fdaee20b81 For #2200, Enable RTC and FLV for GB28181 2021-02-19 18:54:12 +08:00
winlin
548fcd627b Config: Update config files, daemon off, log to console 2021-02-19 18:54:00 +08:00
winlin
61eeb781b7 Always link with pthread 2021-02-19 18:53:48 +08:00
winlin
1f621a6db3 Remove dead code: memory watch 2021-02-19 18:53:40 +08:00
winlin
c6cb0fb21f Refine scripts 2021-02-19 18:53:37 +08:00
winlin
0fe031a156 Support to disable stats by default 2021-02-19 18:53:34 +08:00
winlin
7d75f0af0f Remove dead code 2021-02-19 18:53:27 +08:00
winlin
044df17791 Fix utest fail 2021-02-19 18:53:23 +08:00
winlin
c5d2027f9a RTC: Support high performance timer about 25ms resolution. 4.0.72 2021-02-19 18:53:21 +08:00
winlin
ebcba149ae For #2194, yield for timer, for rtc player 2021-02-19 18:53:18 +08:00
winlin
df1eca10fb For #2194, yield for timer, for rtc publisher 2021-02-19 18:53:16 +08:00
winlin
a049ce3fb7 For #2194, Core: Refine yield for high performance timer. 2021-02-19 18:53:14 +08:00
winlin
a5a96491a3 For #2194, yield for timer, for live publisher 2021-02-19 18:53:13 +08:00
winlin
d1bcc03d9a For #2194, yield for high performance timer, for live player 2021-02-19 18:53:10 +08:00
winlin
c0fda42743 For #2194, Support ST yield 2021-02-19 18:53:08 +08:00
winlin
01687697a1 Fix circleci fail 2021-02-19 18:53:06 +08:00
winlin
b4b9776b02 Core: Support yield current coroutine for high performance timer. 2021-02-19 18:53:03 +08:00
winlin
d8563398b2 Clock: Update stat. Insert timer to execute first 2021-02-19 18:53:02 +08:00
winlin
f987198af0 Clock: Use one system wall clock 2021-02-19 18:52:58 +08:00
winlin
9db7126eb4 Core: Refine ST stat for thread switch 2021-02-19 18:52:56 +08:00
winlin
15f7fa2c36 Core: Refine ST stat for io events 2021-02-19 18:52:54 +08:00
winlin
12d7e57011 Core: Refine sched and clock stat 2021-02-19 18:52:53 +08:00
winlin
c2332f9e55 Core: Use 20ms wall clock 2021-02-19 18:52:49 +08:00
winlin
bddc787a16 Refine the pps. 2021-02-19 18:52:35 +08:00
winlin
70fb647ac9 Perf: Add stat for sched of ST. 2021-02-19 18:52:27 +08:00
winlin
e91e0eaf46 Perf: Add stat for io of ST. 2021-02-19 18:52:12 +08:00
winlin
181c9f25ed Live: Support connect origin by HTTP-FLV/HTTPS-FLV 2021-02-19 18:16:05 +08:00
winlin
76c0c3ff80 Update readme 2021-02-19 15:27:41 +08:00
winlin
bc62d895ec Merge branch '4.0release' into develop 2021-02-19 15:27:27 +08:00
winlin
e1edc101ca Update readme 2021-02-19 15:25:11 +08:00
winlin
884c43791f Merge branch '3.0release' into 4.0release 2021-02-19 15:24:58 +08:00
winlin
37679f2acc Fix utest fail 2021-02-19 11:18:42 +08:00
xialixin@kanzhun.com
4df6fa540f For #2200, Enable RTC and FLV for GB28181 2021-02-18 21:51:49 +08:00
winlin
adb6f723c7 Config: Update config files, daemon off, log to console 2021-02-18 11:39:25 +08:00
winlin
57919e4351 Refine code, move SRS adapter. 2021-02-15 20:01:49 +08:00
winlin
d8e27c3845 Always link with pthread 2021-02-15 19:47:02 +08:00
winlin
4ef1acb700 Remove dead code: memory watch 2021-02-15 19:33:40 +08:00
winlin
0898a1a7ea Refine scripts 2021-02-15 19:24:23 +08:00
winlin
25be6d6bc0 Support to disable stats by default 2021-02-15 13:09:13 +08:00
winlin
f17fa69deb Remove dead code 2021-02-15 12:43:41 +08:00
winlin
3147c8f9bc Fix utest fail 2021-02-15 12:37:16 +08:00
winlin
b1e7e19fd1 RTC: Support high performance timer about 25ms resolution. 4.0.72 2021-02-12 09:31:18 +08:00
winlin
ccb79bc7eb For #2194, yield for timer, for rtc player 2021-02-11 23:10:08 +08:00
winlin
5a28e658a4 For #2194, yield for timer, for rtc publisher 2021-02-11 22:49:54 +08:00
winlin
a04dd7ed30 For #2194, Core: Refine yield for high performance timer. 2021-02-11 22:49:08 +08:00
winlin
4fc1a19415 For #2194, yield for timer, for live publisher 2021-02-11 22:03:00 +08:00
winlin
211b05fc64 For #2194, yield for high performance timer, for live player 2021-02-11 21:15:26 +08:00
winlin
76d6449317 For #2194, Support ST yield 2021-02-11 21:14:45 +08:00
winlin
8d9af57cfa Fix circleci fail 2021-02-11 21:14:04 +08:00
winlin
79f9cd6b3a Core: Support yield current coroutine for high performance timer. 2021-02-11 21:04:09 +08:00
winlin
321f555e30 Clock: Update stat. Insert timer to execute first 2021-02-11 17:34:03 +08:00
winlin
fb61a6979c Clock: Use one system wall clock 2021-02-11 13:39:43 +08:00
winlin
71cc8e35d9 Core: Refine ST stat for thread switch 2021-02-11 13:26:20 +08:00
winlin
e726aba8f9 Core: Refine ST stat for io events 2021-02-11 12:07:38 +08:00
winlin
cde456710d Core: Refine sched and clock stat 2021-02-11 09:39:09 +08:00
winlin
ff388b2f38 Core: Use 20ms wall clock 2021-02-11 09:15:05 +08:00
winlin
99b4866717 Refine the pps. 2021-02-10 21:20:49 +08:00
winlin
a46debb4bb Perf: Add stat for sched of ST. 2021-02-10 20:00:33 +08:00
winlin
7b913b1115 Perf: Add stat for io of ST. 2021-02-10 18:20:11 +08:00
winlin
7a96b28735 Merge 4.0release 2021-02-10 16:32:30 +08:00
winlin
b431ad738c RTC: Refine performance about 700+ streams. 4.0.71 2021-02-10 16:28:11 +08:00
winlin
b7c7d6566f Fix build fail 2021-02-10 16:27:09 +08:00
winlin
2aa94c643c Refine server stat, extract to hybrid server stat 2021-02-10 16:19:51 +08:00
winlin
6b260d6021 Fix utest fail 2021-02-10 16:17:01 +08:00
winlin
7114682eec Timer: Apply timer(HourGlass) to server and sources 2021-02-10 16:16:58 +08:00
winlin
77cffd3e04 Main: Refine sever manager. 2021-02-10 16:16:56 +08:00
winlin
f9bd84109b Timer: Refine the hour glass, support stop 2021-02-10 16:16:52 +08:00
winlin
4a37fe30c7 RTC: Refine RTP header, never extends from any class 2021-02-10 16:16:49 +08:00
winlin
6feaeace27 RTC: Send NACK by timer, no by RTP packet 2021-02-10 16:16:42 +08:00
winlin
d2e728812b RTC: Send NACK by timer, no by RTP packet 2021-02-10 16:14:58 +08:00
winlin
5919865e5d RTC: Refine NACK check, interval, time 2021-02-10 16:14:54 +08:00
winlin
627688c582 RTC: Update stat for received nack 2021-02-10 16:14:47 +08:00
winlin
44c85cc3d2 RTC: Never copy the packet for hijack. 2021-02-10 16:13:25 +08:00
winlin
81db13f27f RTC: Update stat for nack 2021-02-10 16:13:18 +08:00
winlin
51e630d53c RTC: For RTP packet, never switch to context of session except error. 2021-02-10 16:11:07 +08:00
winlin
154ae9b4eb RTC: Update stat for twcc and rr 2021-02-10 16:10:42 +08:00
winlin
86d615f27e RTC: Print stat for pli and timer every 5s. 4.0.70 2021-02-10 16:08:04 +08:00
winlin
9a0e5bc979 RTC: Fix udp recvfrom bug 2021-02-10 16:07:42 +08:00
winlin
ccb6c49029 RTC: Refine timer to 20ms, twcc to 40ms 2021-02-10 15:58:11 +08:00
winlin
d069346f6b Update server stat for fast-id search 2021-02-10 15:58:08 +08:00
winlin
84afeaf433 Update server stat for fast-id search 2021-02-10 15:58:05 +08:00
winlin
44f5ca6a35 Update server stat for fast-id search 2021-02-10 15:58:03 +08:00
winlin
5ae47725e6 SRS: Refine the UDP address parsing, no string 2021-02-10 15:58:01 +08:00
winlin
ca3ac467a3 RTC: Stat the UDP packets and addresses 2021-02-10 15:57:58 +08:00
winlin
2b73c1c7e6 RTC: Refine the UDP address parsing, no string 2021-02-10 15:57:57 +08:00
winlin
52609ea2f0 RTC: Use vector for fast search fast-id 2021-02-10 15:57:55 +08:00
winlin
7f4d8a40e9 RTC: Refine the SRTP protect api 2021-02-10 15:57:52 +08:00
winlin
2989e6c9c3 Fix build fail 2021-02-10 15:57:49 +08:00
winlin
949044d773 RTC: Refine SRTP unprotect rtp and rtcp, without copy 2021-02-10 15:57:44 +08:00
winlin
aec27450e8 RTC: Refine unprotect_rtp to reuse cipher 2021-02-10 15:57:41 +08:00
winlin
719df6fa41 RTC: Parse TWCC SN fastly. 2021-02-10 15:57:38 +08:00
winlin
79a6907a65 RTC: Parse PT fast and refine udp handler. 4.0.69 2021-02-10 15:57:37 +08:00
winlin
826546d518 Refine pps add SrsPps 2021-02-10 15:57:29 +08:00
winlin
c3414a30dc RTC: Refine UDP packet peer fast id. 4.0.68 2021-02-10 15:57:25 +08:00
winlin
e95fd10462 RTC: Don't parse RTP header if no twcc 2021-02-10 15:57:23 +08:00
winlin
49a772770f Refine code 2021-02-10 15:57:21 +08:00
winlin
fec088972d RTC: Fix bug for header parsing 2021-02-10 15:57:17 +08:00
winlin
e17d20c8fa RTC: Refine static cast for RTC connection 2021-02-10 15:57:16 +08:00
winlin
a5b21c159f RTC: Support disable nack 2021-02-10 15:57:13 +08:00
winlin
2b60112130 RTC: Support disable nack 2021-02-10 15:57:12 +08:00
winlin
dffbebfe6f RTC: Fast parse ssrc and find the publisher 2021-02-10 15:57:03 +08:00
winlin
5f31868ce6 RTC: Refine publish stream by find publisher 2021-02-10 15:57:00 +08:00
winlin
6fa3b8212c Update ST doc 2021-02-10 15:56:43 +08:00
winlin
301904467a Update .gitignore 2021-02-10 15:56:34 +08:00
winlin
b0208029bb RTC: Reuse UDP socket to receive packet. 4.0.67 2021-02-10 15:55:35 +08:00
winlin
9ada516e98 At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66 2021-02-10 15:55:01 +08:00
winlin
5eafcea895 RTC: Refine performance for UDP recv context id switch 2021-02-10 15:48:20 +08:00
winlin
b7f5fa7c9d RTC: Fix NACK remove loop bug 2021-02-10 15:48:15 +08:00
winlin
4bcfce7ff1 RTC: Refine is_alive code 2021-02-10 15:48:12 +08:00
winlin
aeca278de0 RTC: Refine log for twcc large timer 2021-02-10 15:47:54 +08:00
winlin
e776e0eca7 Refine server stat, extract to hybrid server stat 2021-02-10 13:07:26 +08:00
winlin
152c161de3 Fix utest fail 2021-02-09 21:56:30 +08:00
winlin
a357c013cd Timer: Apply timer(HourGlass) to server and sources 2021-02-09 17:15:25 +08:00
winlin
ee1d06c613 Main: Refine sever manager. 2021-02-09 12:44:56 +08:00
winlin
98c29a1494 Timer: Refine the hour glass, support stop 2021-02-09 11:54:08 +08:00
winlin
45834b805b RTC: Refine RTP header, never extends from any class 2021-02-09 10:53:44 +08:00
winlin
b189fc3fac RTC: Send NACK by timer, no by RTP packet 2021-02-08 18:28:32 +08:00
winlin
407ae1d7f6 RTC: Send NACK by timer, no by RTP packet 2021-02-08 17:19:20 +08:00
winlin
abc26d470b RTC: Refine NACK check, interval, time 2021-02-08 16:24:12 +08:00
winlin
d505bb6ea6 RTC: Update stat for received nack 2021-02-08 16:23:13 +08:00
winlin
43d4240a30 RTC: Never copy the packet for hijack. 2021-02-08 15:32:56 +08:00
winlin
d01a429c13 RTC: Update stat for nack 2021-02-08 14:14:27 +08:00
winlin
e31169d306 RTC: For RTP packet, never switch to context of session except error. 2021-02-08 13:17:22 +08:00
winlin
515529eba9 RTC: Update stat for twcc and rr 2021-02-08 13:16:07 +08:00
winlin
4539ffa086 RTC: Print stat for pli and timer every 5s. 4.0.70 2021-02-08 11:51:48 +08:00
winlin
18c27111e0 RTC: update stat for pli, timer and dispose 2021-02-08 11:45:34 +08:00
winlin
aefd7fccd0 RTC: Fix udp recvfrom bug 2021-02-08 08:25:35 +08:00
winlin
3d34eb33e5 Fix utest fail 2021-02-07 22:11:35 +08:00
winlin
b4282a6ee1 Fix build fail 2021-02-07 21:39:09 +08:00
winlin
a43f339aa6 Update server stat for cid 2021-02-07 21:33:24 +08:00
winlin
102434b3d5 Context: Use key of thread to store context 2021-02-07 21:31:39 +08:00
winlin
33ab785ce9 RTC: Refine timer to 20ms, twcc to 40ms 2021-02-07 21:08:42 +08:00
winlin
83ab551396 Update server stat for fast-id search 2021-02-07 20:58:24 +08:00
winlin
cbfec753f0 Update server stat for fast-id search 2021-02-07 20:57:22 +08:00
winlin
af499094f8 Update server stat for fast-id search 2021-02-07 20:54:06 +08:00
winlin
ec0d68d6b0 SRS: Refine the UDP address parsing, no string 2021-02-07 20:27:40 +08:00
winlin
638a94ade2 RTC: Stat the UDP packets and addresses 2021-02-07 20:12:54 +08:00
winlin
d41a925694 RTC: Refine the UDP address parsing, no string 2021-02-07 20:05:36 +08:00
winlin
95193979f4 RTC: Use vector for fast search fast-id 2021-02-07 19:31:46 +08:00
winlin
ef279a8b1e RTC: Refine the SRTP protect api 2021-02-07 16:57:48 +08:00
winlin
864356c9bd Fix build fail 2021-02-07 16:32:34 +08:00
winlin
9f91351f3c RTC: Refine SRTP unprotect rtp and rtcp, without copy 2021-02-07 16:21:25 +08:00
winlin
0c07459d19 RTC: Refine unprotect_rtp to reuse cipher 2021-02-07 16:04:19 +08:00
winlin
9a9efb8546 RTC: Parse TWCC SN fastly. 2021-02-07 15:48:46 +08:00
winlin
d184b5662c RTC: Parse PT fast and refine udp handler. 4.0.69 2021-02-07 12:44:00 +08:00
winlin
668f8cbf6c Refine pps add SrsPps 2021-02-06 18:05:04 +08:00
winlin
8cb5cab717 RTC: Refine UDP packet peer fast id. 4.0.68 2021-02-05 18:04:29 +08:00
winlin
7bb04998af RTC: Don't parse RTP header if no twcc 2021-02-05 17:15:19 +08:00
winlin
05441d6354 Refine code 2021-02-05 17:10:42 +08:00
winlin
fd605fc4ac RTC: Fix bug for header parsing 2021-02-05 17:05:46 +08:00
winlin
9c17721eb9 RTC: Refine static cast for RTC connection 2021-02-05 17:02:08 +08:00
winlin
d526e170a5 RTC: Support disable nack 2021-02-05 15:58:54 +08:00
winlin
d0c0f26160 RTC: Support disable nack 2021-02-05 15:52:44 +08:00
winlin
80985c7307 RTC: Fast parse ssrc and find the publisher 2021-02-05 14:13:48 +08:00
winlin
cd06f2da0c RTC: Refine publish stream by find publisher 2021-02-05 14:07:24 +08:00
winlin
f3806126c4 Research: Add udp connect 2021-02-05 11:07:53 +08:00
winlin
de3ec74657 Update ST doc 2021-02-05 10:20:23 +08:00
winlin
960f48721f Update .gitignore 2021-02-05 09:55:21 +08:00
winlin
2b85ad1f60 RTC: Reuse UDP socket to receive packet. 4.0.67 2021-02-04 17:27:32 +08:00
winlin
cfddc8f266 At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66 2021-02-04 16:51:47 +08:00
winlin
19a7c7682e RTC: Refine performance for UDP recv context id switch 2021-02-04 15:48:58 +08:00
winlin
ec01f94b17 RTC: Fix NACK remove loop bug 2021-02-03 19:08:33 +08:00
winlin
0c89e899bd RTC: Refine is_alive code 2021-02-03 18:58:07 +08:00
winlin
1db8a3c92e RTC: Refine log for twcc large timer 2021-02-02 18:05:23 +08:00
winlin
e9a0060890 Merge from 4.0release 2021-01-31 18:11:23 +08:00
winlin
076182cde2 Pick from develop. 4.0.65 2021-01-31 18:08:50 +08:00
winlin
d92bbe7558 RTC: Support eip with port 2021-01-31 18:07:43 +08:00
winlin
3fa767f3cc Build: Support --ssl-local to rebuild openssl even system exists 2021-01-31 18:07:39 +08:00
winlin
cd83054759 ST: Update doc 2021-01-31 18:07:36 +08:00
winlin
09224ea7e0 ST: Update doc 2021-01-31 18:07:31 +08:00
winlin
6e3bd61599 Enable --nasm and --srtp-asm by default for performance. 4.0.64 2021-01-31 18:07:20 +08:00
winlin
945cf64024 Refine srs_player 2021-01-31 18:06:55 +08:00
winlin
f006bf59b1 Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-31 18:06:52 +08:00
winlin
979bf86e8b Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-31 18:06:49 +08:00
winlin
5c41766b79 Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-31 18:06:46 +08:00
winlin
b373400257 RTC: Extract NACK handler from stream to track. 2021-01-31 18:06:40 +08:00
winlin
40ea0b67f9 RTC: Refine RTP packet decoder to track and stream 2021-01-31 18:05:51 +08:00
winlin
0fe85a295c Refine options with default value 2021-01-31 18:05:26 +08:00
winlin
b9a5d4beb6 Refine options with default value 2021-01-31 18:05:07 +08:00
winlin
1615c3df6c RTC: Refine code 2021-01-31 17:59:59 +08:00
winlin
ec2535b183 RTC: Refine code 2021-01-31 17:59:46 +08:00
winlin
62909bb2d0 Merge branch '4.0release' into develop 2021-01-31 17:56:58 +08:00
winlin
0848574902 Research: Add c++11 thread-local 2021-01-31 17:27:47 +08:00
winlin
73c4b1cb6e RTC: Enable -std=c++11 by default. 4.0.65 2021-01-31 14:54:51 +08:00
winlin
e5391ff93d RTC: Support eip with port 2021-01-30 21:36:17 +08:00
winlin
849703bca1 Build: Support --ssl-local to rebuild openssl even system exists 2021-01-26 17:54:44 +08:00
winlin
5678e8e1e7 ST: Update doc 2021-01-26 09:03:39 +08:00
winlin
6ecda1c79e ST: Update doc 2021-01-26 08:58:22 +08:00
winlin
f6720c18c6 Enable --nasm and --srtp-asm by default for performance. 4.0.64 2021-01-25 22:23:42 +08:00
winlin
10205e8cc1 Refine srs_player 2021-01-20 21:06:57 +08:00
winlin
4514947e67 Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-20 20:47:57 +08:00
winlin
f01da568cb Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-20 20:36:30 +08:00
winlin
618333cdd1 Support HTTP-FLV and HLS for srs-player by H5. 4.0.63 2021-01-20 18:59:14 +08:00
winlin
e2bdacb337 RTC: Extract NACK handler from stream to track. 2021-01-19 17:05:40 +08:00
winlin
f2d45442c1 RTC: Refine RTP packet decoder to track and stream 2021-01-19 15:56:42 +08:00
winlin
0c56d11605 Refine options with default value 2021-01-18 17:32:14 +08:00
winlin
1371a47962 Refine options with default value 2021-01-18 17:28:51 +08:00
winlin
e26b685169 Refine script 2021-01-18 12:34:11 +08:00
winlin
09011eea3a RTC: Refine code 2021-01-17 20:30:10 +08:00
winlin
aaa3918a72 RTC: Refine code 2021-01-16 09:52:36 +08:00
winlin
4bb3ad5637 For #2142, Fix bug for fixing memory leak for bridger. 4.0.62 2021-01-15 16:58:23 +08:00
winlin
4e70bf5eaf For #2142, Fix memory leak for bridger of RTC source stream. 4.0.61 2021-01-15 14:16:32 +08:00
winlin
50bb9eb391 Revert "For #2142, RTC: Fix memory leak"
This reverts commit 2492b726af.
2021-01-15 13:31:58 +08:00
winlin
ed32965aa4 Revert "Fix #2142, Async release bridger when unpublish. 4.0.60"
This reverts commit 06adb9dc42.
2021-01-15 13:30:52 +08:00
winlin
06adb9dc42 Fix #2142, Async release bridger when unpublish. 4.0.60 2021-01-14 19:12:01 +08:00
winlin
10ffb2da36 HTML5 video tag resolution adaptive. 4.0.59 2021-01-08 14:16:20 +08:00
winlin
26dec1b037 Release 4.0.58
Merge #2109, Fix bugs for GB28181.
Merge #2109, Refine srs_string_split.
Fix memory leak and bugs for RTC.
2021-01-08 14:16:11 +08:00
winlin
b6843428c6 Fix build warnings 2021-01-08 14:09:28 +08:00
winlin
81d78310a0 Fix build warnings 2021-01-08 13:29:32 +08:00
winlin
61f62ceec6 Fix build warnings 2021-01-08 11:48:56 +08:00
winlin
473942c6f6 Kernel: Add utest for srs_string_split 2021-01-08 10:27:12 +08:00
winlin
8580b1e5fb Merge branch '4.0release' into develop 2021-01-07 18:02:42 +08:00
winlin
f8266fe3b7 Add usage for --cherrypy=on|off when configure 2021-01-07 18:02:24 +08:00
winlin
bfa156247c Merge branch '4.0release' into develop 2021-01-07 17:47:54 +08:00
winlin
6c7ffdeedf Merge branch '3.0release' into 4.0release 2021-01-07 17:27:33 +08:00
winlin
d520679547 Refine code for changing id of stat to string 2021-01-07 17:27:30 +08:00
winlin
1c41f5d796 Merge SRS3, change id of stat to string 2021-01-07 17:04:11 +08:00
winlin
50efd80537 For #2128, #2109, Update authors. 2021-01-07 13:48:39 +08:00
johzzy
3c14a96bdd
fix: html5 video tag resolution adaptive. (#2128) 2021-01-07 13:47:30 +08:00
winlin
248085edfe For #2109, Add more utest for srs_string_split 2021-01-07 12:30:51 +08:00
winlin
2492b726af RTC: Fix memory leak 2021-01-07 11:45:03 +08:00
xbpeng121
47422b7819
GB28181: 无法对接平台问题及一些小bug (#2109)
* 1-新增srs_string_split2函数,该函数支持空串也能按照原有顺序进行切分并放入数组
2-SrsGb28181Device增加属性字段,并在收到catalog命令时能够更新该属性
3-修复sip包解包不严谨bug(body中有可能会有SRS_RTSP_CRLFCRLF那么导致header_body[1]就不一定是body了可能只是body的一部分)

* 1-修复停用rtp多路复用参数(invite_port_fixed)不起作用bug

* bugfix: 当srs发送invite时会指定一个ssrc作为流媒体序列号,但有些平台发流时并不使用这个作为ssrc,而是自己新生成一个。(修复该bug是在invite response时解析内容中的sdp,把对方生成的流媒体序列号ssrc读出来,并且更新srs的channel映射)

* Update push.gb28181.conf

恢复成原来的conf

* bugfix,在取得muxer时需要更新。之前写反了

* Merge branch 'develop' into 4.0release

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 修改sdp_map相同属性的连接符

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 修改sdp_map相同属性的连接符

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 解决冲突时,优先选择原有代码(还原选择develop的代码)

* 回退原来代码

* 删除parse_sdp存储至map相关代码

* 格式恢复

* 格式恢复

* 恢复格式

* srs_string_split() 函数的bugfix

Co-authored-by: xbpeng <xianbin.peng@sibat.cn>
2021-01-06 15:37:02 +08:00
winlin
6cf93557e1 RTC: Fix publish RTC ssrc bug 2021-01-06 12:15:04 +08:00
winlin
fbbdf5ba0e RTC: Fix audio track NULL bug 2021-01-05 18:38:11 +08:00
winlin
040893efde Add research for UDP binding 2021-01-05 18:30:39 +08:00
winlin
155587d2c1 RTC: Fix parse error stap playload crash bug 2021-01-05 10:56:05 +08:00
winlin
ebe38f7337 RTC: Fix RTX bug 2021-01-03 20:01:53 +08:00
winlin
78fcaaf7b1 RTC: Fix memory leak 2020-12-30 16:03:28 +08:00
winlin
03389f5e8c Merge branch '4.0release' into develop 2020-12-27 12:56:45 +08:00
winlin
1df2ea5ca8 Merge branch '3.0release' into 4.0release 2020-12-27 12:56:28 +08:00
winlin
8fa093c53c Merge branch '4.0release' into develop 2020-12-26 22:18:45 +08:00
winlin
2538b02a9b Merge branch '3.0release' into 4.0release 2020-12-26 22:15:37 +08:00
winlin
f9444c376c Merge SRS4 2020-12-24 18:51:04 +08:00
winlin
0ccbd7c40a Support get schema for HTTP message 2020-12-24 18:49:56 +08:00
winlin
af8bf67606 Refine player 2020-12-24 17:19:33 +08:00
winlin
92588c0872 Merge branch '4.0release' into develop 2020-12-24 11:34:17 +08:00
winlin
18d049accc Support disable CherryPy. 4.0.57 2020-12-24 11:33:49 +08:00
jinxue.cgh
7f081b4178 RTC: Refine TWCC from 200ms to 50ms 2020-12-23 15:13:21 +08:00
winlin
c3938ddfd2 Research: Add cost analysis 2020-12-22 19:24:35 +08:00
winlin
a4d1b3e2ca Research: Add cost analysis 2020-12-22 17:36:18 +08:00
winlin
ec212b7413 Merge branch '4.0release' into develop 2020-12-21 12:06:25 +08:00
winlin
764909c6cf Clear disposing then free resources to avoid reuse addresses 2020-12-21 12:05:56 +08:00
winlin
6afdf3addf Merge branch '4.0release' into develop 2020-12-21 12:00:03 +08:00
winlin
e8fa92e3d1 Refine logs for resource manager 2020-12-21 11:59:35 +08:00
winlin
5949eee4f4 Keep resources when dispoing to avoid reuse addresses. 2020-12-21 11:56:22 +08:00
winlin
9217fad73b Hotfix: Print resource address when manager dispose it 2020-12-21 11:28:58 +08:00
winlin
868ee4e443 Merge branch '4.0release' into develop 2020-12-21 10:40:46 +08:00
winlin
39c7151da7 Merge branch '3.0release' into 4.0release 2020-12-21 10:40:27 +08:00
winlin
90b61ad952 Merge SRS4 2020-12-18 10:14:26 +08:00
winlin
5ebf034aea For #1694, Refine API for nb_bytes 2020-12-18 09:56:40 +08:00
winlin
c17474627b Merge SRS3 2020-12-18 09:34:32 +08:00
winlin
576be75f00 Merge branch '4.0release' into develop 2020-12-17 12:28:04 +08:00
winlin
c97e943b07 Merge SRS3 2020-12-17 12:27:47 +08:00
winlin
1502560bcf Update conf 2020-12-13 13:29:30 +08:00
winlin
9caeb606bf ST: Support show coroutines. 2020-12-10 11:36:24 +08:00
winlin
c7c6d8778a RTC: Fix warnings 2020-12-08 16:59:43 +08:00
jinxue.cgh
5309dbe18b RTC: Refine RTCP process 2020-12-07 21:40:51 +08:00
winlin
18ae8d8571 RTC: Fix SDP bug for firefox 2020-12-03 10:58:46 +08:00
winlin
aad7c448bf For #1998, Support Firefox. 2020-12-02 18:23:57 +08:00
winlin
0c113ff084 For #1998, support firefox 2020-12-02 17:29:05 +08:00
winlin
c5457e8241 RTC: Support unified-plan 2020-12-02 12:54:29 +08:00
winlin
27db60cc23 Fix #1996, Heap off-by-one in utest 2020-12-01 19:49:15 +08:00
winlin
c796c0d093 Fix #1689, fix typo 2020-12-01 17:05:47 +08:00
莫战
b38f30c3ee support query parsing and escape 2020-12-01 16:27:37 +08:00
莫战
dc7124cd05 support base64 encode 2020-12-01 16:04:55 +08:00
jinxue.cgh
58b75c6f1b tfsfu: add play red pt negotiate 2020-12-01 13:37:42 +08:00
winlin
140f8b0fce For #1998, refine PT for firefox, support RED 2020-12-01 13:25:53 +08:00
winlin
f47329a94c Update authors, for #2042, #2057 2020-11-30 11:04:02 +08:00
PieerePi
3d5c18c25a
GB28181 code crashed in ffmpeg after commit "RTC: Use FFmpeg to transcode aac to opus" <d5a0ad3dd8>. (#2057)
Change the size from 64K to 256K.
2020-11-30 11:02:30 +08:00
ghostsf
d3e153e504
fix: update CMakeLists.txt for rtc (#2042) 2020-11-25 11:22:32 +08:00
winlin
d66082320f For #2039, update authors 2020-11-17 16:53:05 +08:00
Jesse Xi
8515f5a91e
incomplete_len 在大华摄像头下,因为大华包头对音频的不标准处理,可能为负值,而sizeof(SrsPsPacketStartCode) 返回的是unsigned 类型, 因些增加判断 (#2039)
Co-authored-by: jesse.xi <jj.xi@tianrang-inc.com>
2020-11-17 16:44:37 +08:00
winlin
c779d95246 GB28181: Remove chinese comments. 2020-11-16 00:06:03 +08:00
winlin
977e027d86 SIP: Fix build fail for Mac 2020-11-15 23:47:00 +08:00
winlin
fa3c491c0b For #2014, Merged. 2020-11-15 23:16:55 +08:00
Pieere Pi
ffae1720ec gb28181模块可用性增强
主要改动,
1. 支持作为GB/T 28181上级平台
2. 新的目录接口sip_query_devicelist (/api/v1/gb28181?action=sip_query_devicelist)
3. 各种异常和问题修复
4. 其他一些小改动

以上改动基于feature/rtc分支,因为需要网页用WebRTC来拉GB28181的监控流,gb28181分支代码有点老了。

下面的序号n是指第n个差异块("@@ -"之间的内容)。

srs_gb28181.html
1. 原页面上多加了一个端口号
2-4. 给摄像头加上名称显示
5. 查询目录去掉chid
6. 删除通道参数分解为id和chid
7. API端口固定为1985

srs_app_gb28181.cpp
1-4. 四处因为错误而退出GB28181媒体处理循环,修改为不退出
5. payload为空异常
6. 修正判断startcode越界一个字符导致内存写越界的问题
ps流有可能末尾是全零填充,而且越界的那个字符正好是0x01,这样会多出一个nalu(末尾的三个0x00和一个越界的0x01),后面写video_data内存越界(if (first_pos != pre_pos){块,此处size - pre_pos - 4为-1,uint32_t naluLen得到的值为0,video_data[pre_pos+3] = p[0];写越界)破坏了其他数据,后续video_stream析构出错程序异常退出。
7. 此处srs后来已修复
8. 更新ssrc为被叫返回的值
原代码只支持标准中的《点播域内设备媒体流SSRC处理方式》(设备注册上来),不支持《点播外域设备媒体流SSRC处理方式》(即作为上级平台)。
这是因为如果srs作为上级平台,ssrc不是自己生成的,而是下级平台生成的。
9. 删除通道参数分解为id和chid
10. notify_sip_unregister后delete_stream_channel无效
11. notify_sip_query_catalog清空内存中的设备列表
12. 新函数query_device_list

srs_app_gb28181.hpp
1. update_rtmpmuxer_to_newssrc_by_id声明
2. 新函数get_gb28181_config_ptr和函数delete_stream_channel声明修改
3. 新函数query_device_list

srs_app_gb28181_sip.cpp
1-4. 在调试界面给摄像头加上名称显示;新函数clear_device_list和新函数dumpItemList
5-6. 两处因为错误而退出GB28181信令处理循环,修改为不退出
7. 设备注册上来,不检查服务器ID匹不匹配(支持作为上级平台)
8. 收到一个目录上报消息,更新内存中的数据
9. 更新ssrc为被叫返回的值
10. 新函数query_device_list

srs_app_gb28181_sip.hpp
1. 在调试界面给摄像头加上名称显示
2. 每个设备加上item_list,用于存储目录;新函数clear_device_list和新函数dumpItemList
3. 新函数clear_device_list

srs_app_http_api.cpp
1. 删除通道参数分解为id和chid
2. 新的接口sip_query_devicelist,用于查询所有设备的目录

srs_sip_stack.cpp
1. GB2312转UTF-8类
2. 被叫返回的ssrc初始化
3. parse_xml声明修改
4. 对XML内容进行字符集检测和转换
5-7. parse_xml定义修改
8. SIP BODY里面也有可能有\r\n
9-10. 防止恶意SIP消息 by vicious sip prober
11-12. 新的XML解析目录代码
13. 获取被叫返回的ssrc

srs_sip_stack.hpp
1. 依赖vector
2. 每个设备加上item_list,用于存储目录
3. 被叫返回的ssrc
4. parse_xml声明修改
2020-11-15 23:14:34 +08:00
yinjiaoyuan
fe65c7bf84 For 2034, GB28181: Support transport over TCP 2020-11-15 22:50:59 +08:00
winlin
751dab56d8 RTC: Refine player and publisher 2020-11-15 16:48:30 +08:00
winlin
529264f238 RTC: Refine player and publisher 2020-11-15 15:46:24 +08:00
winlin
3cf3047f97 Add conf/rtc_live.conf 2020-11-14 18:56:49 +08:00
winlin
7521bc86ad For #1998, Update conf 2020-11-13 09:28:24 +08:00
winlin
7136af21de For #1998, TODO: FIME: Should check packetization-mode=1 also. 2020-11-13 08:49:21 +08:00
winlin
5d27c62e95 For #1998, fix fetch remote payload bug. 4.0.56 2020-11-13 08:48:51 +08:00
winlin
4650d47082 For #1998, Support Firefox, use PT in offer. 4.0.55 2020-11-12 18:38:30 +08:00
winlin
57b5204a10 For #1998, Set default fmtp for H264 when transmux RTMP to RTC 2020-11-12 18:36:50 +08:00
winlin
9908433bc8 For #1508, Transform http header name to upper camel case. 4.0.54 2020-11-11 16:38:05 +08:00
winlin
07c04a042a URI: Refine uri parser 2020-11-10 18:51:21 +08:00
winlin
efca38cd89 Player: Change default HTTP-API port to 1985 for WebRTC 2020-11-10 18:07:15 +08:00
winlin
cb4c668249 Merge SRS3 2020-11-10 10:20:55 +08:00
winlin
e085250245 Update players 2020-11-07 11:12:22 +08:00
winlin
32c1832d64 For #1657, refine code 2020-11-07 07:39:50 +08:00
winlin
5709ee1b63 For #1657, add https configs 2020-11-07 07:11:57 +08:00
winlin
385e055c7b For #1657, Fix read bug. 4.0.53 2020-11-06 21:55:17 +08:00
winlin
4618bfc137 For #1657, fix the http read bug 2020-11-06 21:15:19 +08:00
winlin
6dc9824495 For #1657, fix the http read bug 2020-11-06 20:45:44 +08:00
winlin
79655adea0 For #1657, fix the http read bug 2020-11-06 19:53:37 +08:00
winlin
c3f23f4c23 For #1657, fix the http read bug 2020-11-06 19:42:22 +08:00
winlin
c5be7ce8f4 For #1657, Update readme 2020-11-06 19:23:17 +08:00
winlin
a20f02ffe1 For #1657, Read cached data first in SSL. 4.0.48 2020-11-06 19:14:04 +08:00
winlin
a49b2d7b0e For #1657, Support HTTPS Callback, HTTPS API, HTTPS FLV, etc. 4.0.47 2020-11-06 17:35:54 +08:00
winlin
30ba5a32ed For #1657, Support HTTPS Streaming 2020-11-06 17:22:23 +08:00
winlin
faf53927e8 For #1657, Fix utest fail 2020-11-06 15:24:37 +08:00
winlin
272ca9d0f6 For #1657, Support HTTPS API 2020-11-06 15:05:01 +08:00
winlin
7916214e27 For #1657, refine api for http 2020-11-06 09:51:04 +08:00
winlin
5782b45978 For #1657: Refine code 2020-11-05 21:44:47 +08:00
winlin
2fedb683e8 For #1657, refine code 2020-11-05 21:25:55 +08:00
winlin
c3d290013e For #1657, handle on_message_done 2020-11-05 18:34:56 +08:00
winlin
4b082ea96c For #1657, refine http api disconnect log 2020-11-05 18:19:43 +08:00
winlin
74799a31e3 For #1657, refine on_http_message with response writer 2020-11-05 18:08:13 +08:00
winlin
d67b050935 For #1657, fix the jsonp bug 2020-11-05 17:57:22 +08:00
winlin
fc21b31714 For #1657, refine the context for disposing 2020-11-05 17:16:59 +08:00
winlin
b492d59df0 For #1657: Refine code 2020-11-05 16:52:33 +08:00
winlin
0a3a38762a For #1657: Remove duplicated code, merge http api with conn 2020-11-05 16:46:16 +08:00
winlin
9cf4203201 For #1657: Refine code 2020-11-05 15:18:13 +08:00
winlin
24125b9770 For #1657: Refine connection arch, remove hierachy 2020-11-05 15:08:36 +08:00
winlin
2a14dc0ebd For #1657: Refine TCP connections arch 2020-11-05 12:25:54 +08:00
winlin
4ba66b388b For #1657: Refine TCP connections arch 2020-11-05 11:47:24 +08:00
winlin
3038dd473d For #1657, refine connection interface 2020-11-04 20:57:07 +08:00
winlin
0a82719bd3 Refine connection structure 2020-11-04 18:15:43 +08:00
winlin
7c68487bf7 For #1657, Fix utest fail 2020-11-03 17:04:05 +08:00
winlin
d2df045d0e For #1657, enable HTTPS by default 2020-11-03 16:56:05 +08:00
winlin
5577d19b61 For #1657, Refine https-client code 2020-11-03 15:54:06 +08:00
winlin
d552a1a5fb For #1657, support HTTPS client, for http-callback. 4.0.45 2020-11-03 15:45:52 +08:00
winlin
08e19406ef Player: Refine code 2020-11-02 17:21:51 +08:00
winlin
a28f98581e Refine cid for source 2020-10-31 22:04:53 +08:00
winlin
365d3b8bda Merge SRS3.0 2020-10-31 21:53:15 +08:00
winlin
e71d770a26 Update 2020-10-31 21:19:41 +08:00
winlin
e830ca7d0c Research: Add huge coroutine test program 2020-10-31 21:00:09 +08:00
winlin
71c9732bff Support gdb/srs.py to stat coroutines. 4.0.44 2020-10-31 19:30:56 +08:00
winlin
8c1eca98b0 Merge SRS3.0 2020-10-31 19:25:56 +08:00
winlin
ae56293b27 Research: Add simple ST 2020-10-31 11:30:58 +08:00
winlin
941fdebd24 Research: Add mmap demo 2020-10-30 17:49:07 +08:00
winlin
534fcabbd5 Research: Update players 2020-10-30 11:18:08 +08:00
winlin
44e550e523 Research: Add badalloc 2020-10-29 14:52:53 +08:00
winlin
a42da57448 Refine comments 2020-10-29 12:27:44 +08:00
winlin
a7961e558b Research: Learn about the function call 2020-10-29 12:02:33 +08:00
winlin
a060befebf Merge branch '3.0release' into 4.0release 2020-10-28 10:48:54 +08:00
winlin
5e7fe096a9 Refine player pages 2020-10-28 10:48:48 +08:00
winlin
07ecc25071 Merge branch '3.0release' into 4.0release 2020-10-25 13:49:03 +08:00
winlin
adadbb7e9c Merge branch '3.0release' into 4.0release 2020-10-24 18:29:12 +08:00
winlin
99afdb361f Merge branch '3.0release' into 4.0release 2020-10-23 21:48:17 +08:00
winlin
bc9896f91c Merge branch '3.0release' into 4.0release 2020-10-23 21:37:31 +08:00
winlin
a51e275414 Merge SRS3 2020-10-23 21:35:13 +08:00
winlin
be1a1d99de Merge SRS3 2020-10-23 21:22:58 +08:00
winlin
2d11e5f2d7 Update wiki 2020-10-23 20:57:41 +08:00
winlin
4ff8a055c5 Update conf to follow wiki 2020-10-23 20:54:36 +08:00
winlin
d5a0ad3dd8 RTC: Use FFmpeg to transcode aac to opus 2020-10-22 17:07:50 +08:00
winlin
97880f6bb7 ST: Allow set the default stack size 2020-10-22 17:06:36 +08:00
winlin
a14f26971b RTC: add comment for DTLS packet 2020-10-19 12:04:28 +08:00
winlin
9ef8e1bd86 RTC: Refine js for player 2020-10-14 21:11:02 +08:00
winlin
72f87e7cbc RTC: Refine js for player 2020-10-14 20:33:39 +08:00
winlin
07ea733901 Merge branch 'develop' into feature/rtc 2020-10-14 11:40:01 +08:00
winlin
bce55d2789 Merge branch '4.0release' into develop 2020-10-14 11:39:45 +08:00
winlin
913d920ec5 Merge branch '3.0release' into 4.0release 2020-10-14 11:39:26 +08:00
winlin
b602aef56f Merge branch 'develop' into feature/rtc 2020-10-10 17:56:05 +08:00
winlin
39dc118c00 Merge branch '4.0release' into develop 2020-10-10 17:55:48 +08:00
winlin
20293e7e5d Merge 3.0release 2020-10-10 17:54:34 +08:00
winlin
ba6462aab4 RTC: Refine DTLS ARQ, use step interval 2020-10-03 21:34:34 +08:00
winlin
e61391028e RTC: Refine utest for DTLS 2020-10-03 20:10:42 +08:00
winlin
776f24cf3d Refine resource manager, ignore unsubscribed handler 2020-10-02 09:13:41 +08:00
winlin
c120e954f5 Update AUTHORS 2020-09-30 11:18:51 +08:00
chenhaibo
ba29095d10 RTC: fix memory leak bug 2020-09-30 11:16:37 +08:00
winlin
42a2dea5e0 Refine code 2020-09-30 11:14:49 +08:00
winlin
4ccb83834d Fix Kbps resample bug 2020-09-27 16:21:15 +08:00
winlin
99d9d02579 RTC: Print server stats every 5s 2020-09-27 16:10:24 +08:00
winlin
4795244716 Fix stat get time bug 2020-09-27 14:57:18 +08:00
jinxue.cgh
dc3756b8b2 RTC: Compatible with SSRC without mslabel. 2020-09-23 19:59:35 +08:00
winlin
fb6c2fdf80 RTC: Use event notify for stream source 2020-09-23 19:29:19 +08:00
jinxue.cgh
2b47b42213 RTC: Refine PLI request log. 2020-09-21 17:03:48 +08:00
winlin
1a33452e95 Refine resource manager, fix loop and context switching bug 2020-09-20 22:09:03 +08:00
winlin
033e2f9210 Add utest for resource manager 2020-09-20 21:10:48 +08:00
winlin
7e3dfa7149 GB28181: Fix build fail 2020-09-20 18:01:03 +08:00
winlin
4e2fca2b0f Fix utest fail 2020-09-19 12:37:39 +08:00
winlin
253aa23fb1 RTC: Extract resource manager. Use any UDP packet to keep alive. 4.0.43 2020-09-19 11:06:06 +08:00
winlin
7c682a99c9 RTC: Set to alive when got any packet 2020-09-19 11:04:54 +08:00
winlin
8bf677e3c8 Refine code 2020-09-19 10:53:55 +08:00
winlin
1661876633 Fix build fail 2020-09-19 10:41:58 +08:00
winlin
64705d1cc8 RTC: Refine resouce management 2020-09-19 10:30:05 +08:00
winlin
1173d35e33 RTC: Add api in track 2020-09-17 17:15:59 +08:00
winlin
a19aa82029 RTC: Refine log 2020-09-17 16:34:10 +08:00
winlin
5b3f278243 RTC: Refine log 2020-09-17 16:25:24 +08:00
winlin
7459f287e0 System: Add srs duration api 2020-09-17 12:52:16 +08:00
winlin
f7faa13dc5 RTC: Cover connection manager coroutine switch when dispoing conn 2020-09-17 11:44:16 +08:00
jinxue.cgh
27b85c7390 RTC: Fix clear zombie bug 2020-09-16 21:50:24 +08:00
winlin
2a3b5e5290 RTC: Fix mid generation bug 2020-09-16 19:59:49 +08:00
winlin
b4544acc11 Fix build fail 2020-09-16 19:56:06 +08:00
winlin
5ec5f98dcf RTC: Refine sdp for multiple streams 2020-09-16 19:41:34 +08:00
winlin
fe66755bab RTC: Init RTP extension types 2020-09-15 16:40:35 +08:00
winlin
9f31506c83 Refine code 2020-09-15 12:34:00 +08:00
winlin
c26cb9a15b RTC: Support update msid for sdp 2020-09-15 12:31:36 +08:00
winlin
c8af9e9ec4 RTC: Use transformed mid, not the mid of track. 2020-09-15 12:12:46 +08:00
winlin
783029778c Merge branch 'develop' into feature/rtc 2020-09-14 20:55:30 +08:00
winlin
eea36bc261 Merge branch '4.0release' into develop 2020-09-14 20:52:45 +08:00
winlin
991ef94535 Merge branch '3.0release' into 4.0release 2020-09-14 20:52:11 +08:00
winlin
69595089ee RTC: If not exists 42e01f, we pick up any profile such as 42001f. 2020-09-14 17:19:21 +08:00
winlin
dd7587c497 Dispose session when DTLS alert 2020-09-14 10:47:06 +08:00
winlin
86a80396de Add utest for connection manager 2020-09-13 13:08:49 +08:00
winlin
72122c746a Fix utest build fail 2020-09-13 11:01:34 +08:00
winlin
962c379299 Fix build fail 2020-09-13 10:41:37 +08:00
winlin
66c680edb1 Refine code, use SrsConnectionManager 2020-09-11 18:55:18 +08:00
winlin
33f1cb87a2 Refine conneciton manager 2020-09-11 17:26:02 +08:00
winlin
4eae93d27b Rename SrsCoroutineManager to SrsConnectionManager 2020-09-11 17:20:41 +08:00
winlin
d8a158290f Remove unused conn from consumer. 2020-09-11 17:03:48 +08:00
winlin
88826aae8f Rename SrsConnection to SrsTcpConnection 2020-09-11 16:59:22 +08:00
winlin
2135b638b1 Merge srs_app_thread.hpp to srs_app_conn.hpp 2020-09-11 16:44:40 +08:00
winlin
60c759919f Refine code 2020-09-11 15:48:21 +08:00
winlin
697f7d5251 Merge branch 'develop' into feature/rtc 2020-09-10 19:39:25 +08:00
winlin
8b279a9ac4 Merge branch '4.0release' into develop 2020-09-10 19:38:02 +08:00
winlin
0cadbca52f Merge SRS3 2020-09-10 19:36:55 +08:00
winlin
c5f7a90a68 RTC: Fix bug 2020-09-10 17:49:10 +08:00
winlin
2b99b43633 RTC: Fix bug 2020-09-10 17:48:28 +08:00
winlin
e19631a2b7 RTC: Refine PLI request as worker 2020-09-10 17:45:19 +08:00
winlin
4c459a004e Log: Support tag for log 2020-09-10 11:07:21 +08:00
winlin
57288838d0 RTC: Logging for NACK timeout. 2020-09-10 10:50:59 +08:00
winlin
c708103cd4 RTC: Refine NACK RTT and efficiency. 4.0.42 2020-09-09 15:42:02 +08:00
winlin
dfa42cdd8c RTC: Improve NACK RTT 2020-09-09 14:26:42 +08:00
winlin
d61536311b RTC: Remove and refine NACK removing 2020-09-09 14:07:13 +08:00
winlin
f1df0704e8 RTC: Refine code 2020-09-09 13:59:16 +08:00
winlin
0e2f81f023 RTC: Improve NACK efficiency 2020-09-09 13:51:35 +08:00
winlin
cff976bb71 RTC: Improve NACK efficiency 2020-09-09 13:39:10 +08:00
winlin
3026f2fda8 Refine PLI/NACK/DTLS logs. 4.0.41 2020-09-08 13:37:23 +08:00
winlin
579f7a8a5b RTC: Refine cid for PLI 2020-09-03 16:00:12 +08:00
winlin
a0dedba2ab RTC: Fix NACK bug 2020-09-02 11:30:20 +08:00
winlin
5c6946f484 RTC: Refine DTLS alert close_notify log 2020-09-01 16:12:29 +08:00
winlin
b5296d82f4 RTC: Show dtls info 2020-09-01 11:14:41 +08:00
winlin
2cbc00bf61 RTC: Refine PLI log 2020-08-31 20:37:53 +08:00
winlin
2bc6632a22 Server: Add callback for logrotate 2020-08-31 15:09:33 +08:00
winlin
fa1ccaa9f2 Merge branch 'develop' into feature/rtc 2020-08-31 13:39:03 +08:00
winlin
5c2bd2c7f7 Merge branch '4.0release' into develop 2020-08-31 13:38:27 +08:00
winlin
08d2991b53 Fix GB28181 build fail 2020-08-31 13:38:06 +08:00
winlin
3363f39eba Fix GB28181 build fail 2020-08-31 13:37:22 +08:00
winlin
89279f181c Merge branch 'develop' into feature/rtc 2020-08-30 12:56:17 +08:00
yapingcat
23577763cd 把int64_t转成字符串
通过http api 获取streams信息时id显示乱码,应该将int转化为字符串
2020-08-30 12:53:46 +08:00
yapingcat
794563145c 把int64_t转成字符串
通过http api 获取streams信息时id显示乱码,应该将int转化为字符串
2020-08-30 12:53:46 +08:00
winlin
2f22a3d38b For #1926, refine code 2020-08-30 12:43:55 +08:00
jasongwq
7e5572c5e1 FIX:When 28181 stream stopped,Stream API does not remove it 2020-08-30 12:42:23 +08:00
winlin
bbfbc97476 Merge branch 'develop' into feature/rtc 2020-08-30 12:38:47 +08:00
winlin
e4ea2be008 Fix serval bugs for RTC. Refine context API. 4.0.40 2020-08-30 12:26:42 +08:00
winlin
8722bd2e0c Merge branch 'feature/rtc' into develop 2020-08-30 12:16:13 +08:00
winlin
c8eb667a04 Merge branch 'feature/gb28181' into develop 2020-08-30 12:15:58 +08:00
xialixin@kanzhun.com
82f1569f2a When for traverses the device list, send invite and sleep to other threads to update the list, and the conflicting program exits 2020-08-30 12:06:34 +08:00
kyxlx550
d02b560217 remove 28181 is_aac define 2020-08-30 12:06:34 +08:00
kyxlx550
5864ea3472 supprot ps jitbuffer different timestamp of audio and video 2020-08-30 12:06:34 +08:00
winlin
b095c15720 Fix utest fail 2020-08-30 11:55:18 +08:00
winlin
ef8f3d6189 Refine cid for signal thread 2020-08-30 11:46:50 +08:00
winlin
7fed6e631a Refine code 2020-08-30 10:13:23 +08:00
winlin
311cb77b36 Context: Refine API 2020-08-30 09:53:10 +08:00
winlin
cf428b8db4 RTC: Save parent cid for publish stream 2020-08-28 20:21:05 +08:00
winlin
34d119f7b4 RTC: Remove dead code 2020-08-28 20:09:09 +08:00
winlin
f8ad90c68d RTC: Fix source init bug 2020-08-28 15:19:21 +08:00
winlin
d97c0f5db2 RTC: Refine NACK match and miss logs 2020-08-28 12:17:51 +08:00
winlin
8860d0ec62 RTC: Refine options 2020-08-28 11:19:21 +08:00
winlin
1da97b7cde Merge branch 'develop' into feature/rtc 2020-08-24 13:11:32 +08:00
winlin
02a597801f Merge branch '4.0release' into develop 2020-08-24 13:11:05 +08:00
winlin
8609bcf344 Merge branch '3.0release' into 4.0release 2020-08-24 13:10:17 +08:00
winlin
1c07aed2fc Fix bugs 2020-08-21 21:23:32 +08:00
winlin
60aebb5ae3 SRS: Fix bug 2020-08-21 21:15:48 +08:00
winlin
a826926073 SRS: Fix bug 2020-08-21 21:14:18 +08:00
winlin
aaebecbcc9 RTC: Support UnifiedPlan 2020-08-21 18:08:54 +08:00
winlin
d66d100107 Refine code 2020-08-21 17:43:54 +08:00
莫战
aaf956a5c8 fix nack rtcp protect issue 2020-08-21 11:28:48 +08:00
winlin
2b725b8167 Fix bug 2020-08-20 18:46:11 +08:00
winlin
a2d9f0a9ad Fix bug 2020-08-20 18:22:36 +08:00
winlin
7dcfd6b029 Refine code 2020-08-20 18:05:40 +08:00
winlin
2c08c4d303 Fix bug 2020-08-20 17:48:14 +08:00
winlin
d3e739e61b Fix fd leak 2020-08-20 17:39:01 +08:00
winlin
7a9e89d7b3 Fix memory leak 2020-08-20 17:15:07 +08:00
winlin
b41ffed0a2 Refine code style 2020-08-20 16:16:35 +08:00
winlin
7810edd887 Refine code 2020-08-20 14:12:27 +08:00
winlin
afd20563ad Refine string dump to hex 2020-08-20 13:56:05 +08:00
winlin
a712e9cb3d RTC: Fix memory leak 2020-08-20 11:47:38 +08:00
winlin
0716fb4be2 HLS: Fix memory leak 2020-08-20 11:42:05 +08:00
winlin
6bc83e1041 HLS: Fix memory leak 2020-08-20 11:37:25 +08:00
winlin
036cc2a7a2 RTC: Limit the ARQ for DTLS 2020-08-19 21:28:06 +08:00
winlin
1ffea2bcc5 RTC: Refine code 2020-08-19 19:11:42 +08:00
winlin
306a0121ff RTC: Refine code 2020-08-19 19:09:31 +08:00
winlin
9416fddd2b RTC: Refine DTLS impl, extract client and server 2020-08-19 19:06:00 +08:00
winlin
5589120dc8 RTC: Fix bug 2020-08-19 17:48:59 +08:00
winlin
466813b7d5 RTC: Covert client ARQ for DTLS 2020-08-19 17:35:15 +08:00
winlin
e4b0dd56f0 RTC: Covert server ARQ for DTLS 2020-08-19 17:22:34 +08:00
winlin
f33c83a26f RTC: Fix warnings 2020-08-19 17:22:05 +08:00
winlin
f9e17577f7 RTC: Fix conn bug 2020-08-19 10:36:30 +08:00
winlin
1d17666641 RTC: Add utest for DTLS client 2020-08-19 10:31:46 +08:00
winlin
a3e912f5dc RTC: DTLS support ARQ, covered with utest. 4.0.39 2020-08-18 20:24:49 +08:00
winlin
a617d362da Merge branch 'feature/rtc' into develop 2020-08-18 20:00:00 +08:00
winlin
e73e7e47b1 Merge branch 'develop' into 4.0release 2020-08-18 19:56:53 +08:00
winlin
307c644f18 Fix build fail 2020-08-18 19:35:35 +08:00
winlin
17bef0402e RTC: Fix error code for DTLS 2020-08-18 19:29:35 +08:00
winlin
c33dfd2313 RTC: Add utest for DTLS 2020-08-18 19:20:07 +08:00
winlin
9ca6b2e50f RTC: Refine DTLS 2020-08-18 14:45:30 +08:00
winlin
ab221fa842 RTC: Add callback for all consumers done 2020-08-17 20:08:11 +08:00
winlin
88d4314a3c RTC: Refine comment 2020-08-17 18:17:03 +08:00
winlin
66a0143f14 RTC: Refine source state to created and delivering 2020-08-17 18:15:34 +08:00
winlin
5afabe4adf RTC: Remove dead code 2020-08-17 17:47:26 +08:00
winlin
87ffb7071a RTC: Refine code 2020-08-17 17:31:53 +08:00
winlin
1114c6a46a RTC: Refine comments 2020-08-17 17:16:18 +08:00
winlin
3eeeda6a12 Player: Remove jwplayer and osmf 2020-08-17 16:59:25 +08:00
winlin
ecc5f73c54 RTC: Hook beofore publish event 2020-08-17 14:05:01 +08:00
winlin
d5e1116eb7 RTC: Add todo for source cleanup 2020-08-17 11:51:02 +08:00
winlin
9d38009b7f RTC: Ignore twcc if no need to feedback 2020-08-17 11:43:29 +08:00
winlin
1800d9d71b RTC: Support empty RR, ignore it 2020-08-17 11:30:28 +08:00
winlin
fd69635052 RTC: Fix typo 2020-08-17 11:17:58 +08:00
winlin
7069233783 RTC: Refine SDP, parse H264 param 2020-08-13 17:37:04 +08:00
winlin
314e3159f0 RTC: Refine log 2020-08-13 17:23:22 +08:00
winlin
3617acf01c RTC: Refine code 2020-08-13 17:20:03 +08:00
winlin
4c7de039ba RTC: Refine code 2020-08-13 16:27:50 +08:00
winlin
761c880e55 RTC: Refine code 2020-08-13 16:25:56 +08:00
winlin
92b59e308c RTC: Support ARQ for DTLS client 2020-08-13 16:21:01 +08:00
winlin
a5cefbf092 RTC: Cache DTLS packet and fast retransmit it. 2020-08-13 14:41:11 +08:00
winlin
dd9a9b05d1 RTC: Do handshake although ssl done. 2020-08-13 14:22:43 +08:00
winlin
2f50c4eb1a RTC: Refine DTLS 2020-08-13 13:43:23 +08:00
winlin
e7261e1ca6 RTC: Reorder functions 2020-08-13 13:39:43 +08:00
winlin
f79dcc9ae3 RTC: Reorder functions 2020-08-13 13:38:55 +08:00
winlin
ed95124743 RTC: Refine error and log for DTLS 2020-08-13 13:23:45 +08:00
winlin
51bf3707a9 RTC: Refine error and log for DTLS 2020-08-13 12:36:04 +08:00
winlin
6d60e18824 RTC: Refine error and log for DTLS 2020-08-13 12:33:43 +08:00
winlin
9febdaeb48 RTC: Support interval for error pithy print 2020-08-12 17:54:03 +08:00
winlin
2e56aeba96 RTC: Support interval ratio for pithy print 2020-08-12 17:18:51 +08:00
winlin
9d08318581 RTC: Refine error pithy print log 2020-08-12 17:07:37 +08:00
winlin
ea10d7907f RTC: Refine error pithy print log 2020-08-12 17:01:40 +08:00
winlin
d2da74085c RTC: Refine log 2020-08-12 16:07:43 +08:00
winlin
74a0a2e969 RTC: When parsing header, should ignore padding 2020-08-12 15:18:45 +08:00
莫战
559e89caf4 ignore padding decode before srtp decryption 2020-08-12 15:18:15 +08:00
winlin
8a98f05066 RTC: Fix H5 bug 2020-08-12 09:03:34 +08:00
winlin
aac2f1debd RTC: Refine code 2020-08-11 17:13:28 +08:00
winlin
e82e28d83e RTC: Refine RTCP dispatch in connection. 2020-08-11 17:01:57 +08:00
winlin
00582e0c36 RTC: Fix RTCP feedback bug 2020-08-11 15:42:08 +08:00
winlin
f702d8bcd7 RTC: Fix RTCP free bug 2020-08-11 15:30:18 +08:00
winlin
6ae414af3f RTC: Refine RTC hijacker. 2020-08-11 14:29:05 +08:00
winlin
a06a750a1b RTC: Support dup DTLS done. Support create publisher/player after DTLS done. 2020-08-11 12:24:01 +08:00
winlin
f54bf8d9be RTC: Support more than one publishers or players. 2020-08-11 11:06:17 +08:00
winlin
571f417db4 RTC: Refine RTCP packets parsing 2020-08-11 09:50:17 +08:00
winlin
a728e02b93 RTC: Refine RTCP packets parsing 2020-08-11 09:40:27 +08:00
winlin
1591318792 Fix build fail 2020-08-10 18:35:32 +08:00
winlin
8f1af9a13a RTP: Refine RTCP protocol 2020-08-10 17:48:53 +08:00
winlin
f3d8973d67 Fix build fail 2020-08-10 15:43:12 +08:00
winlin
f841e0c37a RTC: Refien NACK code 2020-08-10 15:35:17 +08:00
winlin
f066686255 RTC: When track disable, no NACK. 2020-08-10 15:32:47 +08:00
winlin
250a703588 RTC: Use error pithy print for RTP packet error 2020-08-10 15:29:00 +08:00
winlin
cf9a8c7dcb RTC: Show error when send packets. 2020-08-10 15:24:26 +08:00
winlin
6bc316016b RTC: For NACK, it sequence must match exactly, or it cause SRTP fail 2020-08-10 15:06:08 +08:00
winlin
49bb418e74 Fix TWCC default value 2020-08-07 20:11:37 +08:00
winlin
2d4a4b1d2b Fix build fail 2020-08-07 17:37:35 +08:00
winlin
98ccea8cd3 RTC: Refine code 2020-08-07 17:15:36 +08:00
winlin
a1da95c906 RTC: Support server hijacker 2020-08-07 17:04:34 +08:00
winlin
73eb60a9d5 Tenfold: Connection support send rtcp packet 2020-08-07 16:51:48 +08:00
winlin
8c9935db44 RTC: Connection support hijack 2020-08-07 16:41:55 +08:00
winlin
b0590ef4fe RTC: Remove source from conneciton init. 2020-08-07 15:45:18 +08:00
winlin
cf46779ad9 RTC: Show log when track not found 2020-08-07 15:28:17 +08:00
winlin
937167f311 RTC: Support disable DTLS 2020-08-07 14:33:52 +08:00
winlin
d2264ba6f9 RTC: Support semi security transport 2020-08-07 12:50:54 +08:00
winlin
47c43e47b6 RTC: Fix is_started state init bug 2020-08-07 12:48:45 +08:00
winlin
cfb44f0ef8 RTC: Fix warning 2020-08-06 17:59:14 +08:00
winlin
bbd51e3338 RTC: Allow username is optinal 2020-08-06 17:49:51 +08:00
winlin
a52a81ebb0 RTC: Fix RTCP extension padding bug 2020-08-06 17:25:20 +08:00
winlin
2f1e77aeaf RTC: Fix RTCP app bug. Add is_rtcp_app API. 2020-08-06 17:18:45 +08:00
winlin
e2bf5eaf47 RTC: Remove black line 2020-08-06 16:44:36 +08:00
winlin
87a4c63130 RTC: Add RTX desc 2020-08-06 16:35:33 +08:00
winlin
9f2aaef283 RTC: Add negotiate play by desc 2020-08-06 16:21:52 +08:00
winlin
ffeb3a8c46 RTC: Refine code 2020-08-06 16:15:06 +08:00
winlin
a98187580f RTC: Refine stat for total pkts. 2020-08-06 14:12:31 +08:00
winlin
b070e5aa05 RTC: Move source to play stream 2020-08-06 13:51:12 +08:00
winlin
994c53b6c1 Merge branch '4.0release' into develop 2020-08-06 12:08:46 +08:00
winlin
bbfe457335 Update README 2020-08-06 12:07:03 +08:00
winlin
4984bcbaef Revert "supprot LAS(live adaptive stream)"
This reverts commit c1f98ddcc8.
2020-08-06 12:02:32 +08:00
winlin
9530ea73e3 RTC: Refine error check. 4.0.37 2020-08-06 11:15:28 +08:00
winlin
70d561421c RTC: Check error for send_rtcp_fb_pli 2020-08-05 18:06:54 +08:00
winlin
5c853e02ee RTC: Check error for send_periodic_twcc 2020-08-05 17:46:56 +08:00
winlin
f149c84dd0 RTC: Check error for send_rtcp_rr 2020-08-05 17:24:26 +08:00
winlin
75119a14cf RTC: Check error for send_rtcp_rr 2020-08-05 17:17:33 +08:00
winlin
d156bc2a1b RTC: Refine error, show some bytes for RTCP 2020-08-05 16:47:11 +08:00
winlin
77403dd970 RTC: Refine error log, show some plaintext body bytes. 2020-08-05 16:38:23 +08:00
winlin
77b6151857 RTC: Use srs_string_dumps_hex to dump some bytes when error 2020-08-05 16:23:31 +08:00
winlin
fc10e98f1c RTC: Remove dead code. Fix DTLS empty ctx issue 2020-08-04 20:08:21 +08:00
winlin
d439e36344 RTC: Covert basic packet identify for DTLS/STUN/RTP/RTCP 2020-08-04 17:03:25 +08:00
winlin
49e768ad09 RTC: Fix bug for utest 2020-08-04 16:56:27 +08:00
winlin
103bf86eef RTC: Remove dead code for source 2020-08-04 15:06:51 +08:00
winlin
baceb7f6b0 RTC: Fix the SDP encode issue 2020-08-04 14:07:15 +08:00
winlin
c659098f71 RTC: Set tracks to active for publisher 2020-08-04 13:45:17 +08:00
winlin
dd13889772 BUILD: Compatible with 3.0 options, ignore it 2020-08-03 19:33:34 +08:00
winlin
b847a0a218 BUILD: Compatible with 3.0 options, ignore it 2020-08-03 19:31:14 +08:00
winlin
0905558d49 BUILD: Compatible with 3.0 options, ignore it 2020-08-03 19:28:52 +08:00
winlin
a40abf8df2 RTC: Refine error log 2020-08-03 18:18:15 +08:00
winlin
4aabbd74dc RTC: Cover default status of track 2020-08-03 13:12:39 +08:00
winlin
c72fb76334 RTC: Cover default track status 2020-08-03 13:10:00 +08:00
winlin
0eae1bd493 RTC: Enable track of player when init done. 2020-08-03 12:49:12 +08:00
winlin
8aa20d390e RTC: Disable track by default 2020-08-03 12:36:34 +08:00
winlin
0408040ed7 Fix utest fail for C++11 or C++14 2020-07-30 19:26:28 +08:00
winlin
8e22508057 Refine utest 2020-07-30 18:54:16 +08:00
winlin
2dc311fbd9 Refine code 2020-07-29 22:12:42 +08:00
winlin
3a13d8c380 RTC: Add timer for connection 2020-07-28 17:48:19 +08:00
winlin
d90d42e7bf RTC: Fix warnings 2020-07-28 11:11:16 +08:00
winlin
58702086cc RTC: Refine code 2020-07-27 18:33:49 +08:00
winlin
975c24b24f RTC: Fix warnings 2020-07-27 16:52:44 +08:00
winlin
063c066802 RTC: Refine log 2020-07-27 12:52:46 +08:00
winlin
ca004fe33f RTC: Refine log for error pithy print 2020-07-27 12:44:29 +08:00
winlin
5f7d1e2c5b RTC: Pithy print the address change 2020-07-27 12:28:15 +08:00
winlin
a035d312f9 RTC: Update stat for recv track 2020-07-26 23:28:03 +08:00
winlin
b3212a12de RTC: Update nack stat 2020-07-26 23:18:56 +08:00
winlin
5f7de58095 RTC: Add stat for track. 2020-07-26 22:58:22 +08:00
winlin
133e07e670 RTC: Refine stat code 2020-07-26 21:23:58 +08:00
winlin
0f62587303 Merge branch 'develop' into feature/rtc 2020-07-26 16:42:44 +08:00
winlin
c6a68234cb RTC: Fix publish page 2020-07-26 15:52:36 +08:00
winlin
6545370b7f RTC: Remove dead code. Merge tiny functions. 2020-07-25 09:59:36 +08:00
winlin
21835c38b7 RTC: Support multiple address for client. 4.0.36 2020-07-25 09:33:18 +08:00
winlin
7ec5ef8497 RTC: Fix memory leak for play stream 2020-07-24 18:39:20 +08:00
winlin
069d3ef79d RTC: Suport ULPFEC and RED 2020-07-24 17:01:47 +08:00
winlin
e0c9544995 RTC: Refine code 2020-07-24 16:44:16 +08:00
winlin
bf3b917f1f RTC: Rename SrsRtcOutgoingInfo to SrsRtcPlayStreamStatistic 2020-07-24 10:08:01 +08:00
winlin
0131472ae5 RTC: Rename connection stat 2020-07-24 09:25:30 +08:00
winlin
77256eee08 RTC: Stat summary for connection 2020-07-23 15:14:54 +08:00
winlin
be951b17f1 RTC: Refine code 2020-07-22 18:20:21 +08:00
winlin
c115f77038 RTC: Use error pithy print to reduce dup logs 2020-07-22 15:51:48 +08:00
winlin
c2c35a7330 Refine code 2020-07-22 14:27:03 +08:00
winlin
03105c96c2 RTC: Use isolate cid for UDP mux listener 2020-07-22 12:00:23 +08:00
winlin
d2984ea49c RTC: Refine cid for session 2020-07-21 12:03:18 +08:00
winlin
c9c34b54a7 RTC: Refine cid for session 2020-07-21 11:56:46 +08:00
winlin
3a3d908a63 RTC: Refine twcc to connection 2020-07-21 11:38:41 +08:00
winlin
5f88dc357e RTC: Support address switch 2020-07-21 11:10:20 +08:00
winlin
38f935ead8 Support get hostname 2020-07-20 20:59:28 +08:00
winlin
26f73e7593 RTC: Refine log 2020-07-20 14:39:28 +08:00
winlin
cc03449379 RTC: Remove dead code 2020-07-20 14:29:02 +08:00
winlin
c3219d5431 RTC: Allow dup play. Parse RED desc. 2020-07-20 14:15:08 +08:00
winlin
ef62cab817 RTC: Fail if callback is NULL 2020-07-20 13:55:36 +08:00
winlin
6dd77923ca RTC: Fix rtmp to rtc bug 2020-07-19 10:26:05 +08:00
winlin
7ad1dfbbb8 Merge SRS 4.0 2020-07-19 10:13:48 +08:00
winlin
8ae3ab0ba7 Merge SRS 4.0 2020-07-19 10:09:28 +08:00
winlin
715c70b6e0 RTC: Fix log issue 2020-07-19 10:07:43 +08:00
winlin
2934673d3f RTC: Create file if not exists for append 2020-07-18 09:49:27 +08:00
winlin
1beb24b48d Remove dead code 2020-07-16 13:21:55 +08:00
winlin
52a3f36b39 RTC: Support offer by server 2020-07-16 12:29:40 +08:00
winlin
f33a62e3bd Remove dead code 2020-07-15 13:56:46 +08:00
winlin
991672bf41 RTC: Refine stream/ssrc/sdp structure 2020-07-15 13:11:35 +08:00
winlin
426938cc8a JSON: Filter string filed with special char 2020-07-14 19:51:06 +08:00
winlin
dc8a63fb3c RTC: Refine config code 2020-07-14 14:01:38 +08:00
winlin
deb54b8866 Core: Refine utility string/hex 2020-07-13 14:30:44 +08:00
winlin
66aaad7805 Log: Refine context 2020-07-13 13:52:23 +08:00
winlin
0a057a0427 Log: Refine log context, use const 2020-07-13 11:19:34 +08:00
winlin
254529d946 RTC: Print offer and answer 2020-07-12 19:52:15 +08:00
winlin
041abe43fa Log: Support large log for RTC SDP. 2020-07-12 19:52:03 +08:00
winlin
b20a68ad68 RTC: Refine log 2020-07-12 09:55:35 +08:00
winlin
70c3fc78af Refine log context with random string. 4.0.35 2020-07-11 22:24:17 +08:00
winlin
778e546a11 Merge branch 'feature/rtc' into develop 2020-07-11 22:23:18 +08:00
winlin
a36c0381e8 For #1832, update author 2020-07-11 21:37:19 +08:00
winlin
6ee49c27ae Merge branch 'feature/las' into develop 2020-07-11 21:36:47 +08:00
winlin
dbb88f0d66 Merge branch 'dean-river-feature/las' into feature/las 2020-07-11 21:35:18 +08:00
liulichuan
4048869bce [bugfix]:clear cache_header_index when clear LasCache 2020-07-11 21:34:53 +08:00
winlin
3de3bc8b5e For #1804, Update authors. 2020-07-11 21:30:39 +08:00
yajun18
cfd6ca8ce5 fix, getsockopt SRTO_MAXBW memory overflow 2020-07-11 21:28:30 +08:00
winlin
0a16b1c1e3 Log: Refine log context. 2020-07-11 20:58:25 +08:00
winlin
d68b6b8609 Log: Fix source context print bug 2020-07-11 13:43:26 +08:00
winlin
b143717cbd Build: Change warning to -Wno-deprecated-declarations 2020-07-11 11:48:36 +08:00
winlin
a6b2e28d50 RTC: Refine the api for context. 2020-07-10 18:06:07 +08:00
winlin
22ed55e2e5 Log: Server use the root context 2020-07-09 18:30:48 +08:00
winlin
bbc168d980 RTC: Refine generate_id, never set the cid for current thread 2020-07-09 18:11:49 +08:00
winlin
7052a1fafb Log: Refine context id 2020-07-09 17:16:59 +08:00
winlin
742826a655 Log: Use 8 bytes random string as context id 2020-07-09 16:51:20 +08:00
winlin
5b199249d0 RTC: Rename SrsRtcSource to SrsRtcStream 2020-07-08 19:01:33 +08:00
winlin
428b9f14c0 RTC: Rename SrsRtcPlayer to SrsRtcPlayStream, SrsRtcPublisher to SrsRtcPublishStream 2020-07-07 17:20:15 +08:00
winlin
4c73b9a819 RTC: Rename ISrsRtcPublisher to ISrsRtcPublishStream 2020-07-07 16:57:33 +08:00
winlin
0cdfd062f2 RTC: Rename SrsRtcSession to SrsRtcConnection 2020-07-07 16:37:34 +08:00
winlin
f551ff5ae8 Log: Use string compare function 2020-07-05 23:49:47 +08:00
winlin
6624b8acca Log: Use object as context id for complex context 2020-07-05 23:26:55 +08:00
winlin
bff7ef085d Log: Allow log verbose and info 2020-07-05 22:01:03 +08:00
winlin
51abd55b16 Merge branch 'feature/rtc' into develop 2020-07-04 21:37:30 +08:00
winlin
5f951ca126 HTTP: Fix the http parser fail bug, always reset the parser. 2020-07-04 21:25:56 +08:00
winlin
f8823dab8f ST: add srs_cond_broadcast 2020-07-04 21:18:35 +08:00
winlin
81a7c252d6 TCP: Log the remote port for client. 2020-07-04 17:19:08 +08:00
winlin
e01b98c91e HTTP: Add utest for http infinite chunked 2020-07-04 11:38:09 +08:00
winlin
55e1edc540 Merge branch 'feature/rtc' into develop 2020-07-03 17:05:21 +08:00
winlin
671af4369b HTTP: Only enable infinite chunked for HTTP_REQUEST 2020-07-03 17:05:01 +08:00
winlin
2e28e32f1d HTTP: Only enable infinite chunked for HTTP_REQUEST 2020-07-03 16:50:03 +08:00
liulichuan
c1f98ddcc8 supprot LAS(live adaptive stream)
Change-Id: I2f9fd889fc924a3b080667bd2114f4632be461a0
2020-07-03 11:18:10 +08:00
winlin
2008aa1a99 Update authors 2020-07-03 11:08:27 +08:00
winlin
34e7db5a93 RTC: Fix the DTLS bug 2020-07-03 10:46:35 +08:00
winlin
d453c6c22e Fix some bugs for RTC. 4.0.34 2020-07-03 09:24:13 +08:00
winlin
c62479b112 Merge branch 'feature/rtc' into develop 2020-07-03 09:23:27 +08:00
winlin
62cadd244a RTC: Disable merge_nalus by default 2020-07-03 09:23:02 +08:00
winlin
4146346243 Merge #1830 to fix bugs in GB28181. 4.0.33 2020-07-03 09:20:02 +08:00
xiaozhihong
3bab0ad345 rtc merge_nalu default value off 2020-07-02 21:59:51 +08:00
winlin
5d561b1915 RTC: Fix build fail 2020-07-02 16:28:37 +08:00
winlin
1c3e4c71ee Fix utest fail 2020-07-02 16:28:26 +08:00
winlin
df9efb6486 RTC: Infinite chunk handle read error as EOF. 2020-07-02 16:20:32 +08:00
winlin
545a0efea3 RTC: Refine code 2020-07-02 14:51:32 +08:00
winlin
69fc1ba711 RTC: Prevent DTLS ARQ packet to dup play/publish 2020-07-02 14:51:11 +08:00
winlin
0ec2491bc7
Merge pull request #1830 from xialixin/dev-28181
Fix GB28181 bug.
2020-07-02 13:19:53 +08:00
winlin
9ff8bff601 RTC: Fix the OPTIONS read, no infinited chunked mode 2020-07-02 12:41:08 +08:00
kyxlx550
f287525f85 Merge branch 'dev-28181' of https://gitee.com/kyxlx550/srs into dev-28181 2020-07-02 09:06:31 +08:00
kyxlx550
65a23418ed notes w_ps_file define 2020-07-02 09:06:05 +08:00
kyxlx550
1bbf5c8126 fix ps to h264 frame_size < 0 checkt 2020-07-02 09:06:05 +08:00
kyxlx550
83c2586d79 support audio g711 2020-07-02 09:06:05 +08:00
kyxlx550
6bf1eee2bc fix ps buffer dynamic increase according to stream size 2020-07-02 09:06:05 +08:00
kyxlx550
e506191484 fix rtmp muxer cycle sleep 2020-07-02 09:06:05 +08:00
kyxlx550
ce919a2cbb notes w_ps_file define 2020-07-02 01:35:20 +08:00
kyxlx550
18abfd3063 fix ps to h264 frame_size < 0 checkt 2020-07-02 01:32:32 +08:00
kyxlx550
b574c43676 support audio g711 2020-06-30 23:11:20 +08:00
winlin
a273298e63 HTTP: Enable infinite_chunked by default 2020-06-30 19:29:23 +08:00
winlin
9e447e541b Fix utest failed 2020-06-30 10:05:01 +08:00
winlin
b72cfd2405 Refine options 2020-06-30 09:53:47 +08:00
winlin
3510c74cd4 RTC: Support drop for specified PT 2020-06-29 10:59:39 +08:00
winlin
b9bd12192b Update comment 2020-06-28 19:39:42 +08:00
jinxue.cgh
747be9047c RTC: refine twcc encode_chunk_two_bit 2020-06-28 19:32:17 +08:00
jinxue.cgh
848a073c5c RTC: send twcc in hourglass notify 2020-06-28 19:32:09 +08:00
winlin
b9355c1cc3 Fix memory leak 2020-06-28 16:58:14 +08:00
winlin
75fbcba71d RTC: Always keep and use original sequence. 2020-06-28 11:40:49 +08:00
jinxue.cgh
6662568c11 RTC: sdp surpport ssrc group encode and decode 2020-06-28 11:30:38 +08:00
winlin
f514dd78c1 Merge branch '4.0release' into develop 2020-06-28 10:28:39 +08:00
winlin
78e28dcfde Merge branch '3.0release' into 4.0release 2020-06-28 10:28:14 +08:00
kyxlx550
7419bf4cf4 fix ps buffer dynamic increase according to stream size 2020-06-27 19:38:24 +08:00
winlin
5b54ceadb1 RTC: Refactor code 2020-06-27 16:14:11 +08:00
winlin
e9731fe0c1 RTC: Support ignore padding for RTP header 2020-06-27 16:12:08 +08:00
jinxue.cgh
6ff048ed35 RTC: process twcc before srtp unprotected 2020-06-27 15:59:47 +08:00
winlin
121266ecbf Refine code 2020-06-27 11:17:37 +08:00
winlin
94ebcf6306 RTC: Support config the DTLS role and version 2020-06-27 11:13:53 +08:00
winlin
a6ade57ce5 Refine comments 2020-06-26 15:25:11 +08:00
winlin
5cc0f70f62 RTC: Refine the extensions for RTP. 2020-06-26 15:24:37 +08:00
winlin
62b70943d4 RTC: Fix TWCC delta bug. 2020-06-26 15:20:24 +08:00
winlin
94a4eaffda Ignore any dump files 2020-06-26 15:19:48 +08:00
jinxue.cgh
99016af42a RTC: transport use single srtp 2020-06-25 21:04:18 +08:00
jinxue.cgh
acf9c9d25b RTC: refine get_srtp_key parameter name 2020-06-25 21:04:13 +08:00
jinxue.cgh
b6ecb0a18f RTC: refine srtp layer 2020-06-25 21:04:09 +08:00
winlin
81d2e10f65 Refactor ISrsContext and ISrsLog 2020-06-25 13:14:59 +08:00
jinxue.cgh
2948b90f43 RTC: refine rtc dtls 2020-06-25 12:29:03 +08:00
jinxue.cgh
9addade2b4 RTC: delete SrsDTLS single instance 2020-06-24 20:54:16 +08:00
jinxue.cgh
f3f9636d80 RTC: refine dtls certificate 2020-06-24 20:54:06 +08:00
winlin
0bf0a61401 RTC: Refine DTLS code. 2020-06-24 18:03:09 +08:00
jinxue.cgh
6807299ed2 rtc: refine get dtls_context according request 2020-06-24 17:40:16 +08:00
winlin
98924943a6 Build: Refine the options for configure 2020-06-24 17:03:56 +08:00
winlin
c8892c4009 Fix build failed for no ffmpeg-fit 2020-06-24 13:52:36 +08:00
winlin
7c572dbae3 Merge branch 'feature/rtc' into develop 2020-06-24 13:46:12 +08:00
winlin
6314c273ff Support static link c++ libraries. 4.0.32 2020-06-24 13:36:18 +08:00
winlin
be5d76009e RTC: Support build without RTMP2RTC bridger, no FFmpeg fit. 2020-06-24 12:44:13 +08:00
winlin
677a006709 Update README 2020-06-24 11:45:07 +08:00
winlin
a18cda91b3 Merge branch '4.0release' into develop 2020-06-24 11:40:07 +08:00
winlin
14afe78662 Merge branch '3.0release' into 4.0release 2020-06-24 11:39:17 +08:00
winlin
1c72a89fca Merge branch 'feature/rtc' into develop 2020-06-23 18:58:37 +08:00
winlin
ab6bc39676 Change log cid from int to string. 4.0.31 2020-06-23 18:35:59 +08:00
winlin
acb8793140 RTC: Change reuseport to 1 2020-06-23 18:31:27 +08:00
winlin
89c0748234 Fix the empty cid issue 2020-06-23 17:39:16 +08:00
kyxlx550
868aaaed9e fix rtmp muxer cycle sleep 2020-06-21 21:12:11 +08:00
winlin
a822c841cb Merge branch '3.0release' into develop 2020-06-20 21:48:24 +08:00
winlin
0aea46ac8b Merge remote-tracking branch 'lixin/dev-28181' into feature/gb28181 2020-06-19 13:30:13 +08:00
winlin
7627c290c9 Fix context string ID bug 2020-06-19 08:57:18 +08:00
kyxlx550
d01955443e remove sip device list locker, add sip session locker 2020-06-19 00:46:59 +08:00
jinxue.cgh
83ce78a015 tfsfu: fix compile error for bind, and warning 2020-06-18 11:48:10 +08:00
winlin
8a0c2e01f8 Log: Change cid from int to string 2020-06-18 11:45:43 +08:00
winlin
bca4ec1da1 RTC: Support set the sequence in query string 2020-06-17 15:18:14 +08:00
winlin
cfa74a0715 UDP: Refine context id 2020-06-16 19:45:55 +08:00
winlin
ab4dfbf755 RTC: Fix log typo 2020-06-16 16:50:33 +08:00
winlin
c30565b4c0 RTC: Support keep original seq 2020-06-16 16:41:04 +08:00
winlin
29661802b6 RTC: If NACK disabled, print a log. 2020-06-16 16:17:33 +08:00
winlin
cf738754ae RTC: Generate timestamp only when transcode opus to aac. 2020-06-16 13:39:02 +08:00
winlin
2c1bd6da3e Merge SRS 2020-06-14 12:35:03 +08:00
winlin
e75f28a327 GB28181 with JitterBuffer support. 4.0.29 2020-06-13 13:17:23 +08:00
winlin
1343d4f605 RTC: Disable c++14 2020-06-11 18:16:48 +08:00
莫战
db8d91cbee add c++14 support 2020-06-11 18:15:45 +08:00
winlin
31ff84c82d Ignore some files 2020-06-09 17:18:31 +08:00
winlin
b694550456 Support c++ .h and .cc 2020-06-09 17:17:36 +08:00
kyxlx550
84afc32a96 fix sip catalog status list check error 2020-06-09 10:08:41 +08:00
kyxlx550
ed82d60aac fix while sleep time 2020-06-08 18:27:03 +08:00
kyxlx550
813c83ccc7 fix no maker one frame check 2020-06-08 18:26:08 +08:00
kyxlx550
2172209321 ps to rtmp via source, h264 start code with replace nalulen 2020-06-07 21:51:06 +08:00
kyxlx550
9855e6a715 ps to rtmp via source, h264 start code with replace nalulen 2020-06-07 21:51:06 +08:00
kyxlx550
194dcf504b add ps over rtp jitter buffer 2020-06-07 21:51:05 +08:00
kyxlx550
3fe44c1c84 add lock list 2020-06-07 21:47:22 +08:00
kyxlx550
06548a7fa8 add set socket buffer func 2020-06-07 21:47:22 +08:00
kyxlx550
4fc54c9c99 add gb28181 ps jitter buffeer 2020-06-07 21:47:22 +08:00
kyxlx550
23ce929048 update gb28181 config wait_keyframe default on 2020-06-07 21:47:22 +08:00
winlin
78c232903b Merge branch 'develop' into feature/rtc 2020-06-05 08:47:55 +08:00
winlin
01111a0d77 Merge branch '4.0release' into develop 2020-06-05 08:47:38 +08:00
winlin
153f6f7cf5 Merge branch '3.0release' into 4.0release 2020-06-05 08:46:27 +08:00
winlin
6e04c66402 Support enable C++11. 4.0.29 2020-06-03 19:18:41 +08:00
winlin
5139816feb Remove unused files 2020-06-03 18:14:18 +08:00
winlin
0992eb4580 Remove unused files 2020-06-03 18:00:21 +08:00
winlin
812403a44d Remove srslibrtmp 2020-06-03 17:32:55 +08:00
winlin
8e519cedae RTSP: Show engine and alloc ports 2020-06-03 09:16:11 +08:00
winlin
8ca793593d RTC: Refactor code. 2020-06-02 19:00:31 +08:00
winlin
70d51ffc5b Refine build script 2020-06-02 16:43:07 +08:00
winlin
95f656b46d Merge service to protocol 2020-06-02 15:02:59 +08:00
winlin
f86706e0a2 RTC: Add config for twcc 2020-06-02 14:38:14 +08:00
winlin
32c5b6fbce RTSP: Support video only. 2020-06-02 13:45:23 +08:00
jinxue.cgh
f13a1b8ac0 rtc: fix audio rtp packet no twcc sequenc number, not reset error bug 2020-06-02 11:00:59 +08:00
jinxue.cgh
e2fcd89644 rtc: refine set extension map for rtp_header 2020-06-02 11:00:52 +08:00
winlin
f83276c457 Remove srs-librtmp. 2020-05-31 10:56:36 +08:00
winlin
b8ba4ff779 RTC: Refine code 2020-05-31 10:54:59 +08:00
winlin
96565acd0f Merge branch 'develop' into 4.0release 2020-05-31 10:53:39 +08:00
winlin
899493e968 Fix build failed 2020-05-30 17:52:11 +08:00
winlin
1c5ccaffc7 RTC: Fix memory leak 2020-05-29 17:07:49 +08:00
winlin
a78b6b8cda RTC: Remove --research 2020-05-29 17:02:10 +08:00
winlin
d43d9674a3 RTC: Remove --librtmp 2020-05-29 17:00:06 +08:00
winlin
a3388bf624 RTC: Remove export srs-librtmp support 2020-05-27 14:20:40 +08:00
jinxue.cgh
b8ab6ef6ce RTC: use c++ 98 style map.erase and NULL 2020-05-27 10:15:59 +08:00
winlin
23447dd6e2 RTC: Use c++98 map.earse 2020-05-26 18:24:37 +08:00
winlin
0be9340023 Update config file. 2020-05-26 17:01:01 +08:00
winlin
db43faa848 RTC: Refine blackhole for session 2020-05-26 13:49:27 +08:00
winlin
fccbe98f70 RTC: Remove dead code, no queue_length 2020-05-26 13:45:38 +08:00
winlin
f3e1d28b6b RTC: Fix get candidate IP bug. 2020-05-26 13:08:56 +08:00
winlin
2b50326e97 HTTP: Close connection for HTTP static file server 2020-05-26 09:53:36 +08:00
winlin
f501d5b63d RTC: Support hijack play and consuming 2020-05-24 21:40:23 +08:00
winlin
a5265c5753 RTC: Add comments. 2020-05-24 21:18:46 +08:00
winlin
a246469173 RTC: Fix log typo 2020-05-22 19:06:38 +08:00
winlin
64eb22b95d RTC: Support hijack the plaintext RTP packet 2020-05-22 18:44:32 +08:00
winlin
2bd0e1ce43 Kernel: Buffer supports little-endian 2020-05-22 18:14:15 +08:00
winlin
ab2d15d524 RTC: Fix dup release bug 2020-05-21 21:59:30 +08:00
winlin
6dfeb686bf RTC: Fix session remove bug 2020-05-21 20:23:03 +08:00
winlin
471bb0914f RTC: disable GSO and sendmmsg. 4.0.27 2020-05-21 19:03:50 +08:00
winlin
aaffb8bbd7 RTC: Rename send_packets api. 2020-05-21 17:00:40 +08:00
winlin
9199e40fc1 RTC: Remove dead macros 2020-05-21 16:52:25 +08:00
winlin
01f05f920f RTC: Remove sendmmsg 2020-05-21 16:52:25 +08:00
winlin
9dfa0cc099 RTC: Disable padding 2020-05-21 16:52:25 +08:00
winlin
f03bf601e4 RTC: Directly send without sendmmsg 2020-05-21 16:52:24 +08:00
winlin
4f6b24ea12 RTC: Remove GSO for player, no premature optimization 2020-05-21 16:48:32 +08:00
winlin
5bd2812405 RTC: Merge package AV 2020-05-21 16:48:32 +08:00
winlin
690c64e046 RTC: Notify handler when session timeout 2020-05-20 20:23:21 +08:00
winlin
6a191e4077 RTC: Support destroy session 2020-05-20 19:05:00 +08:00
winlin
4c7792f0f3 RTC: Fix config bug 2020-05-20 13:51:24 +08:00
jinxue.cgh
6ce4ff56f8 rtc: rtp packet encode support twcc extension 2020-05-20 11:28:15 +08:00
winlin
eb0667ba08 RTC: Fix build failed 2020-05-19 20:47:01 +08:00
jinxue.cgh
228e2fab94 rtc: on_twcc delete trace log 2020-05-19 20:37:22 +08:00
jinxue.cgh
95596d9c38 rtc: rtpheader decode add extmap parameter 2020-05-19 20:37:16 +08:00
jinxue.cgh
3681c564d0 rtc: fix rtp header parse extension xlen caclulate bug 2020-05-19 20:37:07 +08:00
jinxue.cgh
9840ad8d55 rtc: support publish twcc using twcc config 2020-05-19 20:35:05 +08:00
jinxue.cgh
d5e91694d5 rtc: publisher support twcc 2020-05-19 20:34:45 +08:00
jinxue.cgh
b116632357 rtc: sdp support decode and encode extmap 2020-05-19 20:31:08 +08:00
jinxue.cgh
705843b512 rtc: support parse rtp packet extension 2020-05-19 20:30:38 +08:00
winlin
69e4a1b5e7 RTC: Refactor variable name 2020-05-19 18:06:12 +08:00
winlin
e3d010113f RTC: Refactor code 2020-05-19 17:49:34 +08:00
winlin
23ddcbdaed Update authors 2020-05-17 21:49:15 +08:00
winlin
3029394c58 RTC: Refactor code 2020-05-17 21:45:50 +08:00
忘篱
5a998e58f5 RTC: Simulator drop packet before SRTP 2020-05-17 21:33:48 +08:00
忘篱
5257f16796 RTC: Attach detail error info when SRTP error 2020-05-17 21:17:44 +08:00
忘篱
d2b0e73884 RTC: Revert not required modifications 2020-05-17 20:43:49 +08:00
忘篱
e9af081f7b RTC: Revert not required modifications 2020-05-17 20:43:46 +08:00
jinxue.cgh
4895770214 tenfold: modify nack options 2020-05-17 20:43:04 +08:00
jinxue.cgh
efe90c36a7 tenfold: add nack option desc 2020-05-17 20:42:48 +08:00
jinxue.cgh
347fafec6e tenfold: refine publish nack send 2020-05-17 20:42:30 +08:00
jinxue.cgh
a3c7be2c75 tenfold: implement nack ringbuffer notify_nack_list_full and notify_drop_seq 2020-05-17 20:42:12 +08:00
jinxue.cgh
c875639eb6 tenfold: use timer send nacks 2020-05-17 20:41:52 +08:00
jinxue.cgh
392e2c8161 tenfold: add publish nack 2020-05-17 20:41:35 +08:00
忘篱
f5ba274019 RTC: Refine RTCP names. 2020-05-17 20:23:57 +08:00
忘篱
d6d2554c7f RTC: Refine comments for TWCC 2020-05-17 20:20:06 +08:00
忘篱
e1bede91f4 RTC: Add api files. 2020-05-17 19:46:18 +08:00
忘篱
acc53ded89 RTC: Extract RTC api file 2020-05-17 19:40:45 +08:00
忘篱
d603b1580e RTC: Merge srs_rtp_seq_distance with srs_seq_is_newer 2020-05-17 09:03:40 +08:00
忘篱
3f5ab8dc63 RTC: Add utest for srs_rtp_seq_distance 2020-05-17 00:03:14 +08:00
忘篱
be1b0bf941 RTC: Refactor code 2020-05-15 18:06:25 +08:00
忘篱
d1485c40e4 RTC: Rename APIs 2020-05-15 15:36:55 +08:00
忘篱
99496ed24c RTC: Remove dead code 2020-05-15 12:07:11 +08:00
忘篱
e20a1d2f39 RTC: Rename RTCP_XXX to RtcpXXX 2020-05-15 12:03:43 +08:00
忘篱
cef8be4a46 RTC: Support RTCP codec. 2020-05-15 11:50:59 +08:00
莫战
9910151feb add twcc and replace auto method 2020-05-15 09:55:15 +08:00
winlin
f510a94a91 RTC: Rename SrsRtpPacket2.rtp_header to SrsRtpPacket2.header 2020-05-15 08:38:43 +08:00
winlin
ba8f2e2aba RTC: Remove dead code 2020-05-15 08:34:58 +08:00
winlin
620ca902e2 RTC: Remove dead code 2020-05-15 08:24:26 +08:00
winlin
d8cf9b64c8 RTC: Remove dead code 2020-05-15 08:19:22 +08:00
winlin
c7b88e08e9 RTC: Refactor API, use shared pkt for consumer 2020-05-15 08:11:03 +08:00
winlin
31de2c71d0 RTC: Reorder code for NACK. 2020-05-15 07:57:40 +08:00
winlin
f2951ec46a RTC: Reorder class, no change 2020-05-14 18:34:33 +08:00
winlin
ab6e3cae52 RTC: Refine NACK, remove dead code 2020-05-14 18:33:31 +08:00
winlin
f81d35d20f RTC: Rename padding API. 2020-05-14 15:01:12 +08:00
winlin
e8973c2343 RTC: Refactor, rename SrsRtcOutgoingPackets to SrsRtcOutgoingInfo 2020-05-14 14:45:54 +08:00
winlin
5e2a3572eb RTC: Remove cache for RTP packet 2020-05-14 14:44:24 +08:00
winlin
7b0a9fe95f RTC: Remove shared bytes, use shared msg 2020-05-14 14:30:32 +08:00
winlin
f794a7d3a7 RTC: Use shared message for RTP packet 2020-05-14 14:26:19 +08:00
winlin
4e1935f678 RTC: Fix GSO build failed in linux 2020-05-14 13:14:52 +08:00
winlin
3cb797dccd For #307, refine core structure, RTMP base on frame, RTC base on RTP. 4.0.26 2020-05-14 10:47:21 +08:00
winlin
2b1c4a188a RTC: Refine RTMP bridge to RTC, use RTP packets in consumer 2020-05-14 09:33:00 +08:00
winlin
54d8c36905 RTC: Refine audio to RTP packet base. 2020-05-13 20:13:25 +08:00
winlin
588d17c09d RTC: Refactor source to accept RTP audio packet. 2020-05-13 18:43:25 +08:00
winlin
377128f4e9 RTC: Rename recode to transcode 2020-05-13 17:56:51 +08:00
winlin
b8b52f28f5 RTC: We should cache the sps/pps in source. 2020-05-13 16:21:42 +08:00
winlin
68de796f77 RTC: Reorder functions 2020-05-13 15:46:49 +08:00
winlin
9b334f91e7 RTC: Fix build failed 2020-05-13 15:27:31 +08:00
winlin
431f852e05 RTC: Remove dead code 2020-05-13 15:23:43 +08:00
winlin
e446cf466f RTC: Extract video to bridger 2020-05-13 15:15:57 +08:00
winlin
8efbdec2af RTC: Remove dead code 2020-05-13 15:13:14 +08:00
winlin
c0021ab78a RTC: Directly use audio transcoder. 2020-05-13 15:09:36 +08:00
winlin
6740a03a9c RTC: Refactor code 2020-05-13 13:42:55 +08:00
winlin
44c8334b71 RTC: Extract codes from source to bridger. 2020-05-13 13:35:14 +08:00
winlin
16c47056a6 RTC: Remove dead code. 2020-05-13 13:15:41 +08:00
winlin
ede6684f12 Fix build failed bug 2020-05-12 19:59:46 +08:00
winlin
9e417d5416 Refine SrsSource, bridge to RTC. 2020-05-12 19:53:21 +08:00
winlin
d2e5cd7bb7 RTC: Refine code, remove pass_timestamp from SrsSource 2020-05-12 13:51:51 +08:00
winlin
d434dc951d RTC: Cleanup code, remove RTC from SrsSource 2020-05-12 13:43:09 +08:00
winlin
c768a8ccd9 Merge branch 'develop' into 4.0release 2020-05-12 13:19:51 +08:00
winlin
25496b734b RTC: Extract RTC Source and Consumer 2020-05-12 13:19:31 +08:00
winlin
d0d8f676c3 For #307, refine RTC publisher structure. 4.0.25 2020-05-11 13:51:50 +08:00
winlin
0b9887bbcd RTC: Rename RTC files. 2020-05-11 12:07:55 +08:00
winlin
3a58d9859c RTC: Extract rtc server in app 2020-05-11 11:45:20 +08:00
winlin
a757b7f903 Support RTC player NACK 2020-05-09 11:11:36 +08:00
winlin
c31ffc40e4 Support filter RTC candidate by ip family, ipv4 by default. 2020-05-09 10:53:52 +08:00
莫战
a72dce494d add rtcp support 2020-05-09 10:51:57 +08:00
winlin
215b1c234b Refine the local ip and interface retrieve 2020-05-09 10:40:25 +08:00
winlin
26bcc09017 Refine on_rtcp for RTC 2020-05-08 16:25:09 +08:00
winlin
9614af070c Support simulator link in DEMO page 2020-05-07 18:28:59 +08:00
winlin
db503975fb Disable simulator API by default. 2020-05-07 16:29:11 +08:00
winlin
fe01a504b6 Fix RTP decode bug 2020-05-07 16:12:04 +08:00
winlin
6fbd41cff4 Refactor the logs. 2020-05-07 16:01:03 +08:00
winlin
1b08fb6b6e Remove unused code 2020-05-06 15:13:18 +08:00
winlin
38d6d5b077 Merge branch 'feature/rtc' into develop 2020-05-06 07:38:46 +08:00
winlin
7dd5db261a Support server as offer 2020-05-06 07:37:00 +08:00
winlin
32fd020de8 Merge branch 'feature/rtc' into develop 2020-05-05 10:51:51 +08:00
winlin
8933e6f429 Fix utest build failed. 2020-05-05 08:35:16 +08:00
winlin
c4b93b8a38 Refactor RTC video queue, extract RTP video packet 2020-05-05 08:24:49 +08:00
winlin
899dddb624 Refactor RTC publisher, audio/video use its special ring buffer 2020-05-05 08:08:03 +08:00
winlin
80d45e5982 Refine RTP ring buffer, change to template 2020-05-05 07:42:27 +08:00
winlin
42ae71e96c Refactor RTC publish queue 2020-05-05 06:41:19 +08:00
winlin
8c4b6d3166 Support disable NACK in config 2020-05-04 20:42:30 +08:00
winlin
d125116317 Support simulate NACK for RTC publisher 2020-05-04 17:49:39 +08:00
winlin
8e5d4ccab7 Merge branch 'feature/rtc' into develop 2020-05-04 14:48:46 +08:00
winlin
4d33070c59 Support NACK for RTC player 2020-05-04 14:47:58 +08:00
winlin
d462b750fb Add TODO: Should not wait for NACK packets. 2020-05-04 08:14:37 +08:00
winlin
f04e63edbf Refactor code, support NACK and NACK PLI in SDP 2020-05-04 07:52:29 +08:00
winlin
15955b6cdd Refactor the RTP packet. 2020-05-04 07:40:02 +08:00
winlin
e2072a0bf6 Merge branch 'feature/rtc' into develop 2020-05-03 20:20:15 +08:00
winlin
47df22df9e Refine RTC, no trickle for ice-lite, disable algorithms right-now 2020-05-03 20:19:45 +08:00
winlin
365e6bb45a Refine RTC publisher, no cache. 4.0.25 2020-05-03 19:09:48 +08:00
winlin
128fc9d8c7 Refactor publisher ring buffer, allow startup drop frame 2020-05-03 18:07:09 +08:00
winlin
2dc8e8dca1 Refactor RTC publish ring buffer 2020-05-03 17:57:07 +08:00
winlin
45f35e3ec8 Refactor RTC publisher, rename pkt to frame 2020-05-03 17:43:38 +08:00
winlin
47ed16eda1 Refactor RTC publisher queue, covert FU-A to RAW. 2020-05-03 17:41:00 +08:00
winlin
a812183144 Refactor the RTC sender audio queue 2020-05-03 14:28:51 +08:00
winlin
a23f102874 Refactor RTC, rename variables. 2020-05-03 13:49:53 +08:00
winlin
9c8b7279f0 Refactor RTC publisher queue, rename sender to player 2020-05-03 13:37:04 +08:00
winlin
ef64c5e2bd Refine RTC, reject when config disabled. 2020-05-03 13:11:38 +08:00
winlin
f71b833520 Refine sendmmsg, move to ST 2020-05-03 11:32:54 +08:00
winlin
2a0562da5e Refine RTC, disable NASM, SENDMMSG, SRTP-NASM 2020-05-03 11:14:11 +08:00
winlin
32c4febafe Refactor RTC publish packet flags. 2020-05-03 10:15:54 +08:00
winlin
157bc713a9 Refactor RTC session API 2020-05-03 09:55:43 +08:00
winlin
5fb7c4efbc RTC supports pass-by players PLI to publisher 2020-05-03 09:00:05 +08:00
winlin
1688d53f7d Refine source, pass-by RTC publisher for player 2020-05-03 07:51:01 +08:00
winlin
20b4984af4 Refine consumer dumps, extract dumps API 2020-05-03 07:43:05 +08:00
winlin
9906d2e859 Refine RTC publish SDP, remove SSRC because it's recvonly. 2020-05-03 07:22:07 +08:00
winlin
780753c0ec Refine code for RTC publisher 2020-05-02 20:57:36 +08:00
winlin
5c43037190 Remove usused RTP shared packet. 2020-05-02 10:24:31 +08:00
winlin
42ee52fa29 Refactor code, extract nack from queue 2020-05-02 10:07:55 +08:00
winlin
f57e8de3f9 Refactor code, rename rtp_xxx_queue to xxx_queue_ 2020-05-02 09:53:49 +08:00
winlin
b3a0284db5 Refactor code to split implementation to cpp 2020-05-02 09:48:04 +08:00
winlin
6f2b78f16a Refactor code to keep sample function order 2020-05-02 09:15:49 +08:00
winlin
7b5fa0e391 Refactor kernel buffer 2020-04-30 20:46:45 +08:00
winlin
d045ce5d74 Refine kernel buffer API. 2020-04-30 19:33:08 +08:00
winlin
efbc51f6be Refactor RTC sender, donot cache it. 2020-04-30 18:19:40 +08:00
winlin
fdcff3e6c2 Refactor code, remove skt in param 2020-04-30 14:49:37 +08:00
winlin
5ee5ef6ab2 For #307, support publish RTC with passing opus. 4.0.24 2020-04-30 10:57:03 +08:00
winlin
99f9f566ba Refactor RTC function names 2020-04-30 10:00:07 +08:00
winlin
583ae52df8 Rename functions for RTC publisher 2020-04-30 09:33:21 +08:00
winlin
f37ffdf740 For RTC publisher, request keyframe when start playing 2020-04-30 08:24:15 +08:00
winlin
ed338f4c0a Refactor macro SRS_AUTO_XXX to SRS_XXX. 2020-04-29 20:02:28 +08:00
winlin
2fe1874a87 For RTC publish, refine the ring buffer. 2020-04-29 19:07:44 +08:00
winlin
5eba90ded9 Refine build script 2020-04-29 19:07:25 +08:00
winlin
0b62ca02b7 Merge develop 2020-04-27 14:01:33 +08:00
winlin
ded37c6719 Refine build script 2020-04-27 13:59:57 +08:00
winlin
89cdfe2f50 Refactor RTC publisher code 2020-04-27 13:45:50 +08:00
winlin
7692e589ed For RTC publisher, support black-hole 2020-04-27 09:35:50 +08:00
winlin
028ef56772 Fix sendmmsg build failed bug 2020-04-26 22:41:03 +08:00
winlin
e4329fd1a0 Refactor RTC, create source once 2020-04-26 19:00:36 +08:00
winlin
cef1ba9385 Update doc 2020-04-26 16:16:34 +08:00
winlin
db586903ba Refactor RTC source create 2020-04-26 16:12:23 +08:00
winlin
eace693ae9 Refactor RTC publish, reorder functions. 2020-04-26 13:30:17 +08:00
winlin
ebdc03416a Free rtc publish. Refactor TAB to spaces 2020-04-25 22:30:55 +08:00
winlin
cd3c15ec4e Support RTC publisher. 2020-04-25 20:32:37 +08:00
winlin
70a81b3970 Fix the bug for RTC publisher 2020-04-25 18:59:02 +08:00
xiaozhihong
bb9367f88a add rtc_publisher.html 2020-04-24 16:22:08 +08:00
xiaozhihong
c068a94f6f Merge remote-tracking branch 'upstream/feature/rtc' into rtc 2020-04-24 16:19:24 +08:00
xiaozhihong
8dc0746e2d rtc publish release 2020-04-24 16:19:08 +08:00
winlin
1a9d4c7d87 Merge branch 'develop' into feature/rtc 2020-04-24 09:42:34 +08:00
winlin
613baa561a Update script 2020-04-24 09:42:15 +08:00
xiaozhihong
775065175a rtc session distinguish play and publish 2020-04-24 00:06:59 +08:00
xiaozhihong
1951cc8e5f remove some debug code 2020-04-23 23:14:30 +08:00
xiaozhihong
a061d5c3db rtc publish, with debug code 2020-04-23 17:08:21 +08:00
xiaozhihong
c654f1e06e Merge remote-tracking branch 'upstream/feature/rtc' into rtc 2020-04-22 22:19:41 +08:00
winlin
ee812290c7 Update usage in README for RTC and GB28181 2020-04-22 17:38:19 +08:00
winlin
0bd3689766 Release v4.0.23 2020-04-22 11:43:05 +08:00
winlin
32082648b6 Merge branch 'feature/rtc' into develop 2020-04-22 11:39:26 +08:00
winlin
ee1002fc3d Fix OSX utest failed. 2020-04-22 11:39:18 +08:00
winlin
38f7299a51 Remove double check for FFMPEG 2020-04-22 09:28:13 +08:00
winlin
854247e979 Fix GB28181 build failed. 2020-04-21 15:38:31 +08:00
winlin
dabad68f48 Merge branch 'feature/gb28181' into develop 2020-04-21 15:27:40 +08:00
winlin
82396ec112 Refactor GB28181 code 2020-04-21 15:25:50 +08:00
winlin
7bec73f224 Refactor demo pages. 2020-04-21 15:13:46 +08:00
winlin
244fefa8c5 Update utest 2020-04-21 15:06:57 +08:00
winlin
f2b575e841 Merge branch 'feature/rtc' into develop 2020-04-21 14:04:27 +08:00
winlin
20896325ea Update script 2020-04-21 14:02:26 +08:00
winlin
bff93c3f6a Update ST doc 2020-04-21 13:30:00 +08:00
kyxlx550
904ce2452b update srs gb28281 web demo 2020-04-21 12:53:52 +08:00
winlin
74800d0137 Refactor code 2020-04-21 12:18:49 +08:00
winlin
511cf65ec8 Add srs_recvmsg 2020-04-21 12:14:26 +08:00
winlin
0fe9d9e324 Add UDP ZeroCopy research 2020-04-21 12:12:32 +08:00
kyxlx550
6a070a9a64 support sip ptz cmd 2020-04-20 21:34:18 +08:00
winlin
74416e476a Refine research zerocopy, use batch for reception 2020-04-20 21:18:49 +08:00
winlin
72322836c6 Update demo for zerocopy 2020-04-20 20:25:23 +08:00
winlin
a3de167bc7 For zerocopy research, support delay in server 2020-04-20 08:42:53 +08:00
winlin
8f9cc38f68 Refine zero copy research 2020-04-20 08:02:53 +08:00
winlin
2e9a561acf Update research zerocopy 2020-04-19 22:16:54 +08:00
winlin
c362bfc3ab Add msg zerocopy research code 2020-04-19 21:58:39 +08:00
winlin
a579f51e72 Remove ST in research 2020-04-19 20:51:39 +08:00
xiaozhihong
749503a12e merge upstream feature/rtc, solve conflict 2020-04-19 15:02:21 +08:00
winlin
65b5081c7d Merge branch 'feature/rtc' into develop 2020-04-19 13:17:53 +08:00
winlin
32879eaf47 Fix double free bug for RTP 2020-04-19 13:16:48 +08:00
winlin
6a4e043349 Fix the double free bug 2020-04-19 11:22:18 +08:00
winlin
b1df04cb09 Fix double free bug for RTP 2020-04-19 09:32:09 +08:00
kyxlx550
167711400a fix cascade SIP bye failed 2020-04-19 00:18:30 +08:00
winlin
ce36a970ff Refine perf stat 2020-04-18 22:55:38 +08:00
winlin
c93cd86ce4 For #307, refine performance 2020-04-18 20:37:08 +08:00
winlin
9e031c9932 Update script 2020-04-18 15:34:36 +08:00
winlin
c1464f5aee Use extra queue when set mw_msgs 2020-04-18 10:35:30 +08:00
winlin
08312ddc42 Support config the mw_sleep and mw_msgs 2020-04-18 10:04:45 +08:00
winlin
b0566d51ef Refine play consume message for RTC 2020-04-18 08:33:35 +08:00
winlin
170b7453f4 Refine for performance 2020-04-18 08:10:28 +08:00
winlin
cf52390cf2 Support fast padding 2020-04-17 18:04:52 +08:00
kyxlx550
fb23739113 fix use gb28181 log id 2020-04-17 17:03:03 +08:00
winlin
e4eb501c57 Fix the perf stat bytes bug 2020-04-17 16:36:56 +08:00
winlin
36d06edab3 Refine performance 2020-04-17 14:24:24 +08:00
winlin
54b6a9faa7 Refactor for performance 2020-04-17 13:02:54 +08:00
winlin
cac5bbddf6 Refine comments 2020-04-17 12:48:05 +08:00
winlin
14e3ec2fe8 For #307, drop frame when VBR too high 2020-04-17 12:30:53 +08:00
winlin
606f8873b3 Refactor code 2020-04-17 10:42:04 +08:00
winlin
acc471b0a9 For #307, refine the GSO for performance 2020-04-17 07:58:11 +08:00
winlin
21ede1f084 Enable perf stat by default 2020-04-17 07:57:52 +08:00
winlin
f0015a7cc1 For #307, refine GSO performance, alloc iovs 2020-04-17 07:10:16 +08:00
kyxlx550
98c29b2b9a fix sip stack param check error 2020-04-17 00:17:47 +08:00
winlin
8383f1b27a Improve performance for GSO 2020-04-16 19:33:10 +08:00
winlin
32f43a9920 For RTC, always try to read message first, to improve performance 2020-04-16 18:52:17 +08:00
winlin
1a6e055f7f Support config to disable stat to improve performance. 2020-04-16 18:37:37 +08:00
kyxlx550
06412ddddc fix gb28281 html ret error show 2020-04-16 18:33:43 +08:00
winlin
810b32138e Refactor code 2020-04-16 18:25:11 +08:00
winlin
634225f92f Improve perforance of marshaling RTP header 2020-04-16 18:04:56 +08:00
winlin
3bd56bb3a3 For #307, reuse fua cache payload for RTP 2020-04-16 14:51:36 +08:00
winlin
d5c514cdcb For #307, reuse raw cache payload for RTP 2020-04-16 14:28:59 +08:00
winlin
d906ced5c3 For #307, set cache to about 1.4GB when clients is 2k 2020-04-16 14:13:09 +08:00
winlin
bbe4b3797d Refactor stat logs for RTC 2020-04-16 13:49:37 +08:00
winlin
e90f0629ed Refactor RTP cache reset 2020-04-16 13:13:02 +08:00
kyxlx550
b391ed6206 fix gb28281 html rtc player stop 2020-04-16 13:08:42 +08:00
winlin
b4a7566684 Print the rtp packets cache capacity 2020-04-16 12:35:36 +08:00
kyxlx550
33b91cd6f2 fix gb28181 api error code 2020-04-16 12:30:11 +08:00
winlin
cc831be985 Refactor variable name for GSO 2020-04-16 12:18:52 +08:00
winlin
92419f9836 For #307, refine GSO padding algorithm 2020-04-16 11:57:11 +08:00
winlin
34fec09bc0 Refactor padding 2020-04-16 11:22:25 +08:00
winlin
4dced0b077 For #307, fix apdding algorithm bug. 2020-04-16 10:58:20 +08:00
winlin
b91e07f475 For #307, change max padding to 127 for GSO. 2020-04-16 10:25:12 +08:00
winlin
5ad99b119d Stat bytes 2020-04-16 10:05:17 +08:00
winlin
b7dab00f36 Add debug_id for GSO 2020-04-16 09:25:18 +08:00
winlin
56995db6a5 Refine debug info 2020-04-16 09:09:10 +08:00
winlin
ef48507e80 Support padding max to 127 2020-04-16 09:07:42 +08:00
winlin
a4dbf3ca8a Fix RTP packet cache bug 2020-04-16 08:43:54 +08:00
winlin
7d1be87124 Fix RTP packet cache bug 2020-04-16 08:30:57 +08:00
winlin
1064429c7e Cache RTP packets 2020-04-15 22:46:06 +08:00
winlin
7b68f55edc Refactor GSO mmsghdr alloc 2020-04-15 22:11:03 +08:00
kyxlx550
7950bc586e add gb28281 demo html 2020-04-15 22:05:32 +08:00
winlin
c96ffd272c Cache RTP packet vector 2020-04-15 21:59:27 +08:00
winlin
d692f2d9c4 Fix build failed when RTC disabled. 2020-04-15 21:37:46 +08:00
winlin
7c6583684e RTC: Reorder AV for GSO 2020-04-15 19:53:23 +08:00
winlin
c95a8517e7 For #307, padding to next packet or GSO size 2020-04-15 17:48:52 +08:00
winlin
bbdd2d7eed For #307, support padding for GSO 2020-04-15 15:58:17 +08:00
winlin
6869ccca50 Fix RTP padding bug 2020-04-15 14:19:00 +08:00
kyxlx550
95b869245b fix sip message parse error 2020-04-15 12:06:27 +08:00
winlin
bfc70d6482 For #307: Change the RTP payload to 1300 2020-04-15 12:05:27 +08:00
winlin
b5f2c842fe Fix perf api bug 2020-04-15 10:50:56 +08:00
winlin
ab53c34945 For #307: Change the RTP payload to 1400 2020-04-15 10:44:26 +08:00
winlin
095e7c5a4e Fix build script 2020-04-15 10:36:39 +08:00
winlin
6e9e0d6ce3 Fix build script 2020-04-15 10:35:38 +08:00
xiaozhihong
e0cd148ad6 merge 2020-04-15 10:31:38 +08:00
winlin
c143c80fd6 Fix GSO stat bug 2020-04-15 07:10:41 +08:00
winlin
dd7b5cf53f Fix GSO stat bug 2020-04-15 06:44:09 +08:00
winlin
649f2042da Update perf tool 2020-04-14 22:16:14 +08:00
winlin
6cf9933bf3 For #307, refine gperf api 2020-04-14 21:49:49 +08:00
winlin
a80084289b Support debug 2020-04-14 20:12:33 +08:00
winlin
8e4ef98629 For #307, correct the RTP packet stat. 2020-04-14 20:12:14 +08:00
winlin
9d5c855727 Update perf api tool 2020-04-14 19:36:43 +08:00
winlin
88b1e14db4 Update perf api tool 2020-04-14 19:30:35 +08:00
winlin
97cfae624c Fix CentOS8 build warnings 2020-04-14 19:23:15 +08:00
winlin
bda7bdee54 Change RTC realtime to 0 cache 2020-04-14 19:19:46 +08:00
winlin
4be1d785b6 Add tool for GSO 2020-04-14 18:50:21 +08:00
winlin
7c3522dcb1 Add tool for GSO 2020-04-14 18:49:26 +08:00
winlin
de343d6547 Add tool for GSO 2020-04-14 18:48:57 +08:00
winlin
8d5f91f777 For rtc player, use target to overwrite server, vhost and eip. 2020-04-14 18:15:07 +08:00
winlin
ba3d293bfd Refactor stat for frames 2020-04-14 14:22:30 +08:00
winlin
7574dbefb1 For #307, support sendmmsg, GSO and reuseport. 4.0.23 2020-04-14 14:02:54 +08:00
winlin
fdc0c44b7e For #307, for realtime, change wait messages from 0 to 2 2020-04-14 13:55:55 +08:00
winlin
03a03e4174 Refine stat for GSO 2020-04-14 13:47:23 +08:00
winlin
5b406d68d6 Refine pithy print 2020-04-14 13:34:24 +08:00
winlin
39853160d1 Refactor default config 2020-04-14 11:49:59 +08:00
winlin
b6a929f9cf Enable GSO by default 2020-04-14 11:41:23 +08:00
winlin
24eb61156f Refine logs for GSO 2020-04-14 11:39:22 +08:00
winlin
8ba3d78e86 Refine logs for GSO 2020-04-14 11:30:21 +08:00
winlin
2cd580f500 For #307, disable GSO < linux 4.18.0 2020-04-14 11:26:45 +08:00
winlin
feaf98eb69 For #307, remove dedicate GSO cache 2020-04-14 10:58:53 +08:00
winlin
23c68a922c Refine GSO for RTC 2020-04-14 10:05:55 +08:00
winlin
8a71ce62db For #307, allow dedicated cache for GSO. 2020-04-14 09:20:21 +08:00
winlin
89a247d9bc Remove unused code 2020-04-13 23:57:03 +08:00
winlin
3b7240b8e0 For #307, support linux GSO for RTC 2020-04-13 23:40:30 +08:00
winlin
b1438bf52c Merge branch 'develop' into feature/rtc 2020-04-13 19:51:35 +08:00
winlin
f072f30854 Merge branch '4.0release' into develop 2020-04-13 19:51:13 +08:00
winlin
bfe40f0115 Check pkg-config 2020-04-13 19:50:40 +08:00
winlin
96059e0d42 For #307, support merge multiple slices/NALUs to one NALU/RTP/FUA 2020-04-13 19:23:17 +08:00
winlin
5d23bb6a8a Refactor code for merge_nalus 2020-04-13 17:11:46 +08:00
winlin
4400896395 Refactor code for merge_nalus and gso 2020-04-13 16:50:24 +08:00
winlin
048301d9eb Refactor RTP sender 2020-04-13 15:37:32 +08:00
winlin
756826756a Refactor RTP encrypt 2020-04-13 15:24:41 +08:00
xiaozhihong
54a887a3d9 solve merge conflict 2020-04-13 14:43:12 +08:00
xiaozhihong
8687c50dc4 merge 2020-04-13 14:29:19 +08:00
winlin
fa21df7bb8 Refactor RTC package RTP packets. 2020-04-13 13:58:34 +08:00
winlin
0bb61f7d98 For #307, RTC RTP support padding 2020-04-13 13:44:55 +08:00
winlin
216b3bf414 Create isolate pithy printer for each RTC FD 2020-04-13 09:32:48 +08:00
winlin
087559813f For #307, use UDP sender binding to FD for RTC 2020-04-13 09:13:12 +08:00
winlin
863d6b4f15 Refactor pithy print for RTC 2020-04-12 23:11:53 +08:00
winlin
59dc771dd5 Refactor pithy print for RTC 2020-04-12 23:05:07 +08:00
winlin
73a9155686 Refine logs 2020-04-12 18:34:42 +08:00
winlin
82579e4b0c For #370, use round-trip to send on all fds 2020-04-12 17:19:49 +08:00
winlin
37e2f8896c Refactor pithy print logs 2020-04-12 16:31:32 +08:00
winlin
d5b3cf9af7 Refactor pithy print logs 2020-04-12 16:10:08 +08:00
winlin
2b132d6d64 Refine RTC server log 2020-04-12 09:17:52 +08:00
winlin
78aad11eeb For #307, enable REUSEPORT to increase UDP buffer 2020-04-12 08:55:43 +08:00
winlin
a7f2bde8e2 Refine UDP socketopt logs 2020-04-12 08:42:12 +08:00
winlin
edad6ac93d Fix memory leak. Refine RTC SEND pithy print message 2020-04-12 08:25:57 +08:00
winlin
5e66a0d342 Send SPS/PPS before IDR 2020-04-12 01:13:31 +08:00
winlin
79d46fa2e1 Fix build failed bug 2020-04-12 01:08:21 +08:00
winlin
32efc71ba9 Fix the STAP NRI flag 2020-04-12 01:05:32 +08:00
winlin
acbbdf51d6 Refacor STAP RTP packet 2020-04-12 01:05:11 +08:00
winlin
ca027ca5cb For #307, zero copy for RTP FUA packet 2020-04-12 01:01:39 +08:00
winlin
aa81b47c9a For #307, zero copy for RTP STAP packet 2020-04-11 23:57:04 +08:00
winlin
4b2404c203 For #307, zero copy for RTP audio packet 2020-04-11 22:54:44 +08:00
winlin
bf62244908 Free RTP packet for RTC 2020-04-11 21:46:34 +08:00
winlin
a2fdf0d3c7 For #307, package video rtp packets when send message 2020-04-11 21:03:37 +08:00
kyxlx550
7826c743e4 support access to NVR, gb28181 system sub domain 2020-04-11 20:37:07 +08:00
kyxlx550
28bde1d448 fix rtmp send timeout, first key frame wait 2020-04-11 20:36:28 +08:00
kyxlx550
f74a398c1b add sip query session api 2020-04-11 20:19:54 +08:00
kyxlx550
1e0474e470 support sip query catalog message, parse xml to map, nvr 2020-04-11 20:18:38 +08:00
kyxlx550
769efa87c3 add sip device channel error code 2020-04-11 20:01:35 +08:00
kyxlx550
3d1c34a45e add gbs log id define 2020-04-11 20:00:31 +08:00
kyxlx550
917b87a1d6 add sip query catalog interval config 2020-04-11 19:56:46 +08:00
kyxlx550
0d593da998 trunk/conf/full.conf
add sip query catalog interval config
2020-04-11 19:55:42 +08:00
winlin
8121f9ab4e Refactor variable name 2020-04-11 18:39:46 +08:00
winlin
c6fb5e6fdd Refactor code, rename variable 2020-04-11 18:01:38 +08:00
winlin
3cccef327c For #307, package opus when send it. 2020-04-11 17:52:14 +08:00
winlin
1f2db4d746 For #307, refactor aac to opus code 2020-04-11 17:09:55 +08:00
winlin
6ed2a4b6cb For #307, refine audio transcode buffer 2020-04-11 16:33:47 +08:00
winlin
7ffe4aacb8 For #307, refactor shared msg, add samples and extra payload 2020-04-11 15:26:20 +08:00
winlin
5b9cb7dc3f For #307, refactor code, parse B-frame by sample. 2020-04-11 15:11:42 +08:00
winlin
719c0ae85b For #307, refactor SPS/PPS only before IDR, not each FUA 2020-04-11 13:10:27 +08:00
winlin
a695afb368 Refactor code to rename rtp_shared_pkt to packet 2020-04-11 09:56:58 +08:00
winlin
a1371fe93c Fix utest warnings 2020-04-11 09:11:46 +08:00
winlin
1ecd8bee40 Refactor bframe discard strategy 2020-04-11 09:11:34 +08:00
winlin
fca81f02f5 Refactor code, add comment when string.assign(xx, 0) 2020-04-11 09:00:50 +08:00
winlin
162055f6d0 Refactor variable name 2020-04-10 19:21:47 +08:00
winlin
d6a5651a30 For #307, support reload rtc_server section 2020-04-10 18:14:33 +08:00
winlin
928d863e50 Refactor code, use pithy print for RTC send. 2020-04-10 17:42:54 +08:00
winlin
94afe6c56e Refactor the print message 2020-04-10 15:44:46 +08:00
winlin
40eb5c0ef5 For #307, disable vappi for FFmpeg-fit 2020-04-10 08:55:04 +08:00
winlin
9b2f429571 Allows empty body metadata. 2020-04-09 20:43:51 +08:00
winlin
c54d5be93c For #307, refine RTP packet cache. 2020-04-09 19:38:50 +08:00
winlin
1a7c98b5fc Refine README 2020-04-09 15:20:32 +08:00
xiaozhihong
c81bc36712 add rtc stun/dtls log 2020-04-09 14:34:48 +08:00
winlin
1e83749485 For #307, use RTC server to sendmmsg 2020-04-09 09:56:13 +08:00
winlin
cf48a5594d Refactor code for #1691 2020-04-09 08:37:28 +08:00
winlin
49f88a3326
Merge pull request #1691 from xialixin/dev-28181
Dev 28181
2020-04-09 08:28:53 +08:00
winlin
d9a5572531 Refine TAB to spaces. 2020-04-09 08:20:55 +08:00
winlin
d59ec158f9 Merge remote-tracking branch 'john/rtc' into feature/rtc 2020-04-09 08:17:21 +08:00
xiaozhihong
85fcbad778 [1].Add 'stun_strict_check' in conf file
[2].Try to pickup at least H.264 payload type
2020-04-08 23:24:59 +08:00
xiaozhihong
55f264b704 Merge remote-tracking branch 'upstream/feature/rtc' into rtc 2020-04-08 20:40:23 +08:00
winlin
99614ac585 Support set RTC stun timeout 2020-04-08 15:22:13 +08:00
xiaozhihong
ca7060c005 Add SrsRtpHeader. 2020-04-08 14:45:26 +08:00
winlin
e6e8605304 For #307, support config RTC session timeout 2020-04-08 13:30:28 +08:00
winlin
8e0f83fdd2 Fix CentOS8 build failed 2020-04-07 20:22:18 +08:00
winlin
11bcd0cb27 Merge branch 'develop' into feature/rtc 2020-04-07 20:19:06 +08:00
winlin
737e4fce9f Merge branch '4.0release' into develop 2020-04-07 20:18:48 +08:00
winlin
61c7443c4b Merge from SRS3 2020-04-07 20:18:31 +08:00
winlin
32d5b75d8c For #307, fix some memory leaking 2020-04-07 19:47:04 +08:00
winlin
a8cc3a3430 For #307, fix some memory leaking 2020-04-07 19:07:11 +08:00
winlin
e22d1dffc1 Merge remote-tracking branch 'john/rtc' into feature/rtc 2020-04-07 17:30:06 +08:00
winlin
fa635e3333 Refine sendmmsg detect script 2020-04-07 17:28:24 +08:00
winlin
6c5b51618c For #307, support config to send plaintext RTP. 2020-04-07 16:05:31 +08:00
winlin
00810e6d1d Refine api for tcmalloc 2020-04-07 14:43:18 +08:00
winlin
963720e1eb Fix tcmalloc build bug 2020-04-07 14:30:17 +08:00
winlin
35a037cf05 Add api for tcmalloc 2020-04-07 14:24:14 +08:00
winlin
574ae58adc For #307, support mock server eip by API 2020-04-07 11:36:26 +08:00
winlin
b2f0696976 Fix build warning 2020-04-07 11:36:03 +08:00
winlin
bb0ca05390 Merge branch 'develop' into feature/rtc 2020-04-06 21:38:05 +08:00
winlin
9c1dfb79d3 Fix gperf build bug 2020-04-06 21:37:37 +08:00
winlin
368e93e9e8 For #307, support use sendto or sendmsg when senmmsg(1 msg) 2020-04-06 21:24:06 +08:00
winlin
59b9fa9610 For #307, always 1 if os does not support sendmmsg 2020-04-06 19:42:37 +08:00
winlin
7cfd2879b0 For #307, config sendmmsg max 2020-04-06 00:24:14 +08:00
winlin
40c95b04ca Merge remote-tracking branch 'winlin/feature/perf_stat' into feature/rtc 2020-04-05 23:01:21 +08:00
winlin
b8db61bd9c For #307, Support disable sendmmsg 2020-04-05 22:13:49 +08:00
winlin
6f7ebbdc5f Merge branch 'develop' into feature/rtc 2020-04-05 21:59:46 +08:00
winlin
f228b3809a Fix utest failed. 2020-04-05 21:22:50 +08:00
winlin
dc3df926eb For #307, support configure with sendmmsg. 2020-04-05 18:34:57 +08:00
winlin
b23525033b Merge branch 'develop' into feature/rtc 2020-04-05 17:21:07 +08:00
winlin
10d5f99d3d For #307, SRTP ASM only works with openssl-1.0, auto detect it. 4.0.22 2020-04-05 17:14:22 +08:00
winlin
133e3ce075 For #307, use sendmmsg in rtc server 2020-04-05 16:53:08 +08:00
xialixin
d2b8b937d6 fix generate ssrc, rtmp muxer cycle sleep, ps steam parase etc.. 2020-04-05 13:53:14 +08:00
xialixin
9e9b5374d5 srs_get_sip_utc_date external use 2020-04-05 13:51:19 +08:00
xialixin
c70ed1cd74 add sip session status check 2020-04-05 13:49:47 +08:00
xialixin
778f12508f add todo info log level compile error 2020-04-05 13:48:42 +08:00
xialixin
8ac39cb22f del print_sip_message config 2020-04-05 13:45:52 +08:00
winlin
737dcdd2c8 Merge branch 'develop' into feature/rtc 2020-04-04 22:48:33 +08:00
winlin
9943565ec9 Merge RTC and GB28181, with bugs fixed. 4.0.21 2020-04-04 22:45:16 +08:00
winlin
fbdec8a760 Merge branch 'develop' into 4.0release 2020-04-04 22:43:53 +08:00
winlin
55a4052d90 For #307, support sendmmsg to improve RTC performance 2020-04-04 22:43:44 +08:00
winlin
3793404ceb Refine scripts 2020-04-04 20:24:24 +08:00
winlin
634fa27320 Refine configure cleanup script 2020-04-04 18:47:12 +08:00
winlin
654cde109d Fix options script bug 2020-04-04 17:10:45 +08:00
xialixin
92d351ef35 fix 'output' format define; support 'host' auto get; time config use SRS internal format; support auto create stream channel on/off 2020-04-04 16:07:23 +08:00
xialixin
5e4fdfd1d4 fix after RTMP is closed, empty PPS and SPS. sip client sockaddr set 2020-04-04 16:07:23 +08:00
xialixin
ac8acc0b22 fix 28281 to 28181, sip heart message, timeout channel peer ip and port reset 2020-04-04 16:07:23 +08:00
winlin
c5c0df6536 Update build script 2020-04-04 15:44:56 +08:00
winlin
573449f1b0 For #307, refine RTC latency from 600ms to 200ms. 4.0.20 2020-04-04 15:36:35 +08:00
winlin
5144794044 Detect older docker and disable SRTP ASM 2020-04-04 14:50:36 +08:00
winlin
c666933cd2 Fix circleci script 2020-04-03 23:02:52 +08:00
winlin
f504cb2724 Refine build script 2020-04-03 22:46:04 +08:00
winlin
366d800720 For #307, use files of openssl 1.0.* 2020-04-03 21:59:32 +08:00
winlin
5ad58933a9 For #307, build SRTP with openssl to improve performance. 4.0.19 2020-04-03 21:14:06 +08:00
xiaozhihong
22fe799649 Add annotation about rtp packet. Remove no need verbose log. 2020-04-03 16:35:47 +08:00
winlin
0ff3ce7464 Merge remote-tracking branch 'john/rtc' into feature/rtc 2020-04-03 15:17:13 +08:00
winlin
9e7e80f5f5 Add TODO comment for Cert 2020-04-03 15:08:52 +08:00
winlin
8c42ad622b Config to use RSA or ECDSA 2020-04-03 15:05:04 +08:00
winlin
c70a0eb07c Config to use RSA or ECDSA 2020-04-03 15:03:09 +08:00
winlin
5e06a2568b For #370, support SRTP with ASM(enable openssl) by default 2020-04-03 14:37:48 +08:00
winlin
cdb20c79cc Revert part of 01d5e4da, to keep both openssl 1.0 and 1.1, because SRTP depends on 1.0 2020-04-03 14:03:57 +08:00
winlin
862c211acd Support openssl 1.0 and 1.1, RSA and ECDSA 2020-04-03 13:43:13 +08:00
winlin
81bb8747f2 Refine script 2020-04-03 13:42:52 +08:00
winlin
bd05f69d0b Refine openssl build script on OSX 2020-04-03 13:42:24 +08:00
winlin
9ad5a5d9b6 RTC support openssl 1.0.* 2020-04-03 13:41:45 +08:00
winlin
f853c7a1e0 Support start SRS when wireshark capturing 2020-04-03 13:40:34 +08:00
xiaozhihong
3cf03393c0 format a=candidate line 2020-04-02 21:31:22 +08:00
xiaozhihong
d6adb5cd8d process USE-CANDIDATE/ICE-CONTROLLING/ICE-CONTROLLED atrribute in STUN 2020-04-02 21:31:06 +08:00
winlin
15384e61e2 Remove duplicated build for srtp2 2020-04-02 12:33:58 +08:00
winlin
8de89f3f37 Add TODO for SRTP-GCM for RTC 2020-04-02 12:28:47 +08:00
winlin
51bae42560 For RTC, verify peer and accept all certificate. 2020-04-02 11:41:57 +08:00
winlin
302da32fc5 When configure, default to make clean 2020-04-02 11:41:36 +08:00
xiaozhihong
bfd8971db8 fix compile warning. 2020-04-01 14:56:31 +08:00
xiaozhihong
4f671b1de2 Merge remote-tracking branch 'upstream/feature/rtc' into rtc 2020-04-01 14:39:05 +08:00
xiaozhihong
14421a7f0b add annotation about some sdp line 2020-04-01 14:38:00 +08:00
xiaozhihong
f4067bcb4d fix nack bug 2020-04-01 14:37:14 +08:00
winlin
608f3d0fae For #1500, support push stream by GB28181. 4.0.18 2020-03-31 23:06:07 +08:00
winlin
d81cde695d Refactor code 2020-03-31 22:48:38 +08:00
winlin
e19b927f92 Merge GB28181 2020-03-31 22:45:20 +08:00
winlin
6012ac4eb0 Refine code 2020-03-31 22:30:57 +08:00
winlin
a342f460e7 Merge branch '4.0release' into xialixin-dev-28181 2020-03-31 20:09:07 +08:00
winlin
33455867f9 Merge branch 'dev-28181' of https://github.com/xialixin/srs into xialixin-dev-28181 2020-03-31 20:08:24 +08:00
winlin
df6274daf8 Merge branch 'feature/rtc' into develop 2020-03-31 18:19:15 +08:00
winlin
4ac8991a8e Update author to runner365 for SRT 2020-03-31 18:10:44 +08:00
winlin
74ad7143e7 Change authro to Bepartofyou for RTC codec 2020-03-31 18:05:32 +08:00
winlin
45db63249d Update author to John for RTC 2020-03-31 18:03:04 +08:00
winlin
6022ac5cdb Add comments for RTC candidate. 2020-03-31 17:33:04 +08:00
winlin
ecf0f012b5 Add comments for RTC candidate. 2020-03-31 17:26:32 +08:00
winlin
c8aaa5a1a6 Update circle CI script 2020-03-31 16:40:08 +08:00
winlin
c7113f27e0 Play stream by WebRTC on iOS/Android/PC browser. 4.0.17 2020-03-31 09:35:36 +08:00
xialixin
c99fb99ab6 refactor gb28181, supporting SIP server enable, multiplex, API interface 2020-03-31 00:39:10 +08:00
winlin
03289012fd Refactor code for RTC 2020-03-30 21:21:31 +08:00
winlin
e65b6283df Merge remote-tracking branch 'john/rtc' into feature/rtc 2020-03-30 20:46:15 +08:00
winlin
f9f9cfda9b Refine cherrypy install script 2020-03-30 18:25:22 +08:00
xiaozhihong
9dadcdffd6 Merge remote-tracking branch 'upstream/feature/rtc' into sdp 2020-03-30 15:16:44 +08:00
xiaozhihong
49da2099c1 sdp exchange. 2020-03-30 15:16:29 +08:00
winlin
bf297fd070 Refine make help 2020-03-29 21:36:41 +08:00
winlin
60d810693c Refine rebuild components 2020-03-29 21:30:32 +08:00
winlin
056fcd2928 Refine clean script 2020-03-29 19:06:51 +08:00
winlin
40cc8ed47c Refine file path for st and ffmpeg 2020-03-29 18:44:01 +08:00
winlin
a60dbc167a Update macro 2020-03-29 18:01:46 +08:00
winlin
3b8450d4bd Support cleanup componets 2020-03-29 17:54:27 +08:00
winlin
6935bb18ae Merge branch '4.0release' into develop 2020-03-29 17:36:33 +08:00
winlin
6b8f0d84a3 Merge branch '3.0release' into 4.0release 2020-03-29 17:31:41 +08:00
winlin
22fbae139c Refine links use relative path 2020-03-29 17:15:29 +08:00
winlin
22ec783c3f Merge branch '3.0release' into 4.0release 2020-03-29 16:52:46 +08:00
winlin
84652265d9 Update README 2020-03-29 00:23:16 +08:00
winlin
cc6a447332 Merge feature/rtc 2020-03-29 00:21:00 +08:00
winlin
32d818d69c Merge 4.0release 2020-03-29 00:16:37 +08:00
winlin
13ee53434e Merge branch '4.0release' into develop 2020-03-29 00:14:46 +08:00
winlin
3e0a7ee7fb Merge branch '3.0release' into 4.0release 2020-03-29 00:13:41 +08:00
winlin
0fd75434a6 For #307, fast build openssl 2020-03-28 21:33:47 +08:00
winlin
c1e124786c For #307, fix build warnings for rtc 2020-03-28 20:57:03 +08:00
winlin
dae7af8444 For #307, rtc support osx 2020-03-28 20:52:42 +08:00
winlin
04c3370458 Merge branch 'develop' into feature/rtc 2020-03-28 18:06:40 +08:00
winlin
f29db522c1 Merge branch '4.0release' into develop 2020-03-28 18:05:46 +08:00
winlin
9e8b88825b Merge branch '3.0release' into 4.0release 2020-03-28 18:05:19 +08:00
winlin
c2b02f86fa Merge 4.0release 2020-03-28 17:46:47 +08:00
winlin
217b8b94b6 Merge 3.0release 2020-03-28 17:45:14 +08:00
winlin
90a39ec46d Add api to stat mw iovec 2020-03-27 13:37:39 +08:00
winlin
ccd170a813 Update readme for RTC 2020-03-24 13:54:23 +08:00
winlin
0d060a1cec For #1659, #307, support aliyun slb UDP health check 2020-03-24 12:12:41 +08:00
winlin
57c23d93c1 Refactor url for rtc player 2020-03-23 13:36:17 +08:00
winlin
4c63319b5d Release rtc_player to ossrs.net 2020-03-23 10:36:15 +08:00
winlin
8a7f35dc6d Release rtc_player to ossrs.net 2020-03-22 22:52:51 +08:00
winlin
6edca6147c Release rtc_player to ossrs.net 2020-03-22 22:51:09 +08:00
winlin
f8b4ba1e5a Release rtc_player to ossrs.net 2020-03-22 22:48:51 +08:00
winlin
98d372bd40 Release rtc_player to ossrs.net 2020-03-22 21:54:18 +08:00
winlin
2b6da30ac6 Welcome maintainers Runner365, John, B.P.Y(Bepartofyou). 4.0.15 2020-03-22 21:22:15 +08:00
bepartofyou
923209b070 Merge remote-tracking branch 'srs/feature/codec' into feature/rtc_audio 2020-03-22 20:16:24 +08:00
bepartofyou
8332a2fbdb ffmpeg ubuntu build files 2020-03-22 20:15:23 +08:00
bepartofyou
766da5188b Merge remote-tracking branch 'srs/feature/codec' into feature/rtc_audio 2020-03-22 19:55:29 +08:00
winlin
e5e2d05da0 For #307, support play with WebRTC. 4.0.14 2020-03-22 19:46:56 +08:00
bepartofyou
4a17259471 err wrap change to new 2020-03-22 19:36:11 +08:00
winlin
41acc5033e For #307, support disable asm for FFMPEG 2020-03-22 19:26:26 +08:00
winlin
2f4ccc27f6 Update authors 2020-03-22 18:59:43 +08:00
winlin
caf7e9e6ea Merge branch 'feature/rtc' into develop 2020-03-22 18:53:39 +08:00
winlin
c00ffa530b Merge branch 'feature/codec' into feature/rtc 2020-03-22 18:42:49 +08:00
winlin
a912f0475f Merge branch 'feature/ffmpeg' into feature/codec 2020-03-22 18:17:37 +08:00
winlin
602a478e1b For #1659, #307, add switch to disable rtc 2020-03-22 18:17:05 +08:00
winlin
37c84eccc0 For #1659, #307, add x86 asm for ffmpeg for rtc 2020-03-22 17:14:07 +08:00
xiaozhihong
734e848741 Update RtcSession peer address when changed. 2020-03-22 16:54:31 +08:00
winlin
4308f238c0 For #1659, #307, add ffmpeg-4.2-fit for rtc 2020-03-22 16:34:54 +08:00
winlin
634a14bfa6 For #1659, #307, add opus codec library 2020-03-22 14:03:48 +08:00
winlin
2da4e0a43e For #1638, #307, config to discard aac for rtc 2020-03-22 08:28:51 +08:00
winlin
e1fe2d1c1d For #1638, #307, add comments for audio codec 2020-03-22 07:18:25 +08:00
七曦
f09dda85fc Exception handle 2020-03-21 23:27:28 +08:00
winlin
2757ec7973 Merge from bepartofyou 2020-03-21 23:09:57 +08:00
winlin
0cd67a997e For #1638, #307, add comments for vhost rtc config 2020-03-21 22:52:59 +08:00
winlin
be746da21c Merge branch '3.0release' into 4.0release 2020-03-21 22:42:17 +08:00
七曦
a0a4337214 make webrtc audio work 2020-03-21 21:50:06 +08:00
xiaozhihong
7315b1a26d Fix config read "bframe" discad bug. 2020-03-21 21:40:26 +08:00
xiaozhihong
fa700dad64 1. Modify rtc.conf to support Bframe discard.
2. Rename srs_app_rtp.cpp to srs_app_rtc.cpp
2020-03-21 21:26:30 +08:00
winlin
b6b52363fb Update authors 2020-03-21 19:41:59 +08:00
winlin
97035d2301
Merge pull request #1654 from cainiaoDJ/update_cmakelists_for_clion
更新CMakeLists.txt文件,使项目能在clion编译通过
2020-03-21 19:39:46 +08:00
winlin
955de3dac9 Merge branch '3.0release' into 4.0release 2020-03-21 19:36:16 +08:00
winlin
68ad006b73 Remove empty line. 2020-03-21 19:03:17 +08:00
winlin
3f6a2871b0 For #1638, #307, show error information when api failed. 2020-03-21 19:00:47 +08:00
winlin
d2036455ac Refactor api, follow https://github.com/rtcdn/rtcdn-draft 2020-03-21 18:33:36 +08:00
winlin
61b8ae8c30 Refactor api, follow https://github.com/rtcdn/rtcdn-draft 2020-03-21 18:30:53 +08:00
winlin
3360db7b77 Refactor api, follow https://github.com/rtcdn/rtcdn-draft 2020-03-21 17:56:26 +08:00
winlin
532750f18a Refactor api data, url to api 2020-03-21 17:33:54 +08:00
winlin
de9a004ff7 Merge branch 'dev-28181' of https://github.com/xialixin/srs into feature/gb28281-2 2020-03-20 21:39:04 +08:00
yanghuiwen
2911c814c4 更新CMakeLists.txt文件,使项目能在clion编译通过 2020-03-20 17:07:16 +08:00
winlin
881506883e Update 2020-03-20 15:16:30 +08:00
xialixin
8b4f84e336 fix push.gb28181.conf, gb28181conn repeat call serve() 2020-03-20 10:38:38 +08:00
xialixin
cbe9c1dabc Support gb28181 sip over udp, ps steam over rtp 2020-03-20 00:01:48 +08:00
winlin
8eef439c90 For #1638, #307, use hourglass for timer. 2020-03-19 12:58:04 +08:00
winlin
830e60da29 For #1638, #307, update authors for rtc 2020-03-19 10:36:47 +08:00
HuyaJohn
94e4f4539d merge feature/rtc, fix conflict 2020-03-18 16:34:15 -07:00
HuyaJohn
d1d16d490e Detect B frame in avc stream. Fix compiler error with verbose 2020-03-18 16:27:31 -07:00
winlin
0b6e9257f9 For #1638, #307, remove unused code for rtc 2020-03-18 18:35:02 +08:00
winlin
018577e685 For #1638, #307, fix error new bug for rtc 2020-03-18 18:12:37 +08:00
winlin
979d7c3f4f For #1638, #307, refactor rtc player. 2020-03-18 17:21:50 +08:00
winlin
c210c0b2f5 For #1638, #307, refactor rtc player. 2020-03-18 10:03:20 +08:00
xiaozhihong
e2233027b8 fix h264 rtp packet error 2020-03-18 08:45:20 +08:00
winlin
fc84f1e545 Refactor source cid with pid 2020-03-17 18:43:11 +08:00
winlin
28c1c57854 For #1638, #307, should set err in return value. 2020-03-17 18:33:05 +08:00
winlin
0ff8a3761b For #1638, #307, should check error by fetch_or_create source 2020-03-17 18:24:28 +08:00
winlin
ed2996141c For #1638, #307, refine api and udp for rtc. 2020-03-17 18:11:03 +08:00
winlin
2c4dc0fb3d For #1638, #307, extract rtc server to hybrid manager. 2020-03-17 17:56:37 +08:00
winlin
4318d989a6 For #1638, #307, switch to RTC session context cid for cleanup 2020-03-17 12:41:50 +08:00
winlin
25fec76ea9 For #1638, #307, switch to RTC session context cid for reusing UDP ports 2020-03-17 12:33:08 +08:00
winlin
29b9203428 For #1638, #307, use short-term http connection for rtc to use new cid. 2020-03-17 12:10:42 +08:00
winlin
6118ca382a For #1638, #307, http api success with message, timeout as such 2020-03-17 11:40:05 +08:00
winlin
b5dd502103 For #1638, #307, fix build warnings 2020-03-17 09:16:52 +08:00
HuyaJohn
e8b2bb5d28 process err, do error check, add some error code 2020-03-16 07:35:24 -07:00
winlin
c2a667cc35 For #1638, #307, add comments for api and enum 2020-03-16 22:01:09 +08:00
winlin
2f0b150588 For #1638, #307, accept srs_string_dumps_hex to app utility. 2020-03-16 18:05:42 +08:00
winlin
e905fce847 For #1638, #307, add comments in RTMP/RTP message for RTC. 2020-03-16 17:39:06 +08:00
winlin
9e856c84e7 For #1638, #307, remove unused bash variable. 2020-03-15 15:58:28 +08:00
winlin
4b23d04635 For #1638, #307, fix rtc player demo bug 2020-03-14 23:22:25 +08:00
winlin
60c8b37f05 For #1638, #307, merge john, add NACK suport, remove debug code, verbose log 2020-03-14 22:51:35 +08:00
winlin
c2916acd92 For #1638, #307, define webrtc:// url for play 2020-03-14 22:48:02 +08:00
xiaozhihong
2b56f9ee59 add NACK suport, remove debug code, verbose log 2020-03-14 22:11:01 +08:00
winlin
12e99f1897 For #1638, #307, use webrtc adapter.js for demo. 2020-03-14 21:14:17 +08:00
winlin
a42cf3ae8d For #1638, #307, refactor rtc config. 2020-03-14 18:05:58 +08:00
winlin
6f4584db53 Merge SRS4 2020-03-14 17:16:51 +08:00
winlin
51af2b4779 For #1638, #307, rtc conf support ENV. 2020-03-14 17:15:46 +08:00
winlin
a135eb2144 Merge SRS3 2020-03-14 14:39:11 +08:00
winlin
70307ed8f9 Update README 2020-03-14 14:35:57 +08:00
xiaozhihong
6c88f58079 remove debug code, fix rtc.html 2020-03-13 22:50:34 +08:00
winlin
d21ef106a0 Merge branch 'rtc' of https://github.com/xiaozhihong/srs into xiaozhihong-rtc 2020-03-13 21:18:09 +08:00
xiaozhihong
768598a3bb add kernel rtp packet 2020-03-13 20:35:07 +08:00
xiaozhihong
027d34bbd3 add rtp shared packet 2020-03-13 20:34:40 +08:00
winlin
a7c8980a60 For #1636, muxing sh, use sound_rate if aac sr not set. 2020-03-13 17:36:22 +08:00
winlin
7036f839d2 For #1636, add comments 2020-03-13 17:05:22 +08:00
winlin
aa20a04abb For #1636, fix bug for mux AAC to ADTS, never overwrite by RTMP sampling rate. 4.0.13 2020-03-13 16:56:00 +08:00
winlin
c66f33ac87
Merge pull request #1636 from runner365/3.0release.srt.dev
support all aac sample rate in srt2rtmp
2020-03-13 16:46:49 +08:00
xiaozhihong
6decdc7838 adjust code style, fix some bug, add rtc session timeout 2020-03-13 00:24:56 +08:00
winlin
1382337cb4 Merge SRS3 2020-03-12 22:42:33 +08:00
runner365
f102a598b8 Merge branch 'develop' into 3.0release.srt.dev 2020-03-12 20:30:59 +08:00
runner365
b9195122cf support all sample rate in aac 2020-03-12 20:30:07 +08:00
winlin
b33751e2c1 Merge SRS3 2020-03-12 12:18:15 +08:00
winlin
6a765ab849 Merge SRS3 2020-03-11 19:45:01 +08:00
HuyaJohn
da72caf8b9 h264 packet done, chrome play well 2020-03-11 04:21:44 -07:00
xiaozhihong
e831f3254a some code 2020-03-11 00:04:12 +08:00
HuyaJohn
ff0e03800d h264 rtp debuging 2020-03-10 04:47:49 -07:00
xiaozhihong
e2675109fb fix rtp h264 packet bug 2020-03-10 00:45:40 +08:00
HuyaJohn
3ae510b843 rtp dispatch done, but video can not play in chrome 2020-03-09 04:46:27 -07:00
xiaozhihong
2f462775a0 rtp support 2020-03-09 00:40:30 +08:00
HuyaJohn
2e68c375e3 start coding flv->rtp 2020-03-08 04:20:46 -07:00
xiaozhihong
c62901a3ac make code easy, wrap udp remux socket 2020-03-08 00:30:31 +08:00
winlin
5586c2a128 For #1612, refactor return value for RTSP initialize. 2020-03-07 22:42:23 +08:00
winlin
48be5b6245 Update authors 2020-03-07 22:37:12 +08:00
winlin
dcb0553cc8 For #1612, fix crash bug for RTSP. 4.0.12 2020-03-07 22:35:11 +08:00
winlin
12a74326e8
Merge pull request #1612 from xialixin/develop
Fix disconnect RTSP connection has assertion, resulting in program exit
2020-03-07 22:31:34 +08:00
winlin
5f9ded73ce
Merge pull request #1625 from wasphin/feature/remove-unused-ip
Remove unused ip variable
2020-03-07 22:28:56 +08:00
winlin
41acf9ca8e For #1631, support sei_filter for SRT. 4.0.11 2020-03-07 22:25:19 +08:00
winlin
82824ba98a
Merge pull request #1631 from runner365/3.0release.srt.dev
add h264 sei filter configure
2020-03-07 22:20:25 +08:00
runner365
a2839aacdf add h264 sei filter 2020-03-07 16:15:36 +08:00
HuyaJohn
b730458d51 add candidates ip list, add rtc_upload.html to test 2020-03-06 23:28:15 -08:00
runner365
4242985b36 update only support h264+aac 2020-03-07 15:15:14 +08:00
xiaozhihong
a36ed6954f add rtc.html temp 2020-03-06 23:59:59 +08:00
xiaozhihong
936ba7583e modify depend.sh 2020-03-06 23:40:20 +08:00
xiaozhihong
9d5495c0c2 "stun and dtls done" 2020-03-06 23:01:48 +08:00
Xiaofeng Wang
b525fc65aa Remove unused ip variable
* "inet addr" is not compatible with rhel/centos 7+;
* ifconfig has been replaced by ip-utils in newer distro;
2020-03-03 21:10:43 +08:00
xiaozhihong
30d8b2209f parse sdp 2020-03-02 22:47:40 +08:00
runner365
40a09958c4 add checking for pes_parse 2020-03-01 19:42:32 +08:00
winlin
72155fc645 For #1621, support mix_correct for aggregate aac for SRT. 4.0.10 2020-03-01 10:34:33 +08:00
winlin
1b9a705e4b For #1621, support mix_correct for aggregate aac packets. 4.0.10 2020-03-01 10:17:03 +08:00
winlin
492ea6ed52
Merge pull request #1621 from runner365/develop
solve audio timestamp bugs and video dts/pts bugs
2020-03-01 10:12:47 +08:00
winlin
f917cc1e0c
For SRT, perfer mix_correct to true as default. 2020-03-01 10:09:44 +08:00
runner365
6224eb2af6 Merge branch 'develop' of https://github.com/ossrs/srs into develop 2020-02-29 16:48:26 +08:00
runner365
7f4cc6221c 1,solve audio timestamp bugs;2,solve video dts increase bugs 2020-02-29 16:47:20 +08:00
xiaozhihong
62563bdd81 rtc framework 2020-02-28 23:18:39 +08:00
winlin
39a1d9a613
Merge pull request #1620 from runner365/3.0release.srt.dev
solve dts==0 bug and solve many aac packed in a large mpegts(2930bytes)
2020-02-27 09:42:05 +08:00
runner365
ed1a3aa37c Merge branch 'develop' into 3.0release.srt.dev 2020-02-26 17:46:44 +08:00
runner365
9e90870779 solve dts==0 bugs; solve large aac 2930bytes timestamp bugs 2020-02-26 11:14:34 +08:00
runner365
4bd37d43b4 solve dts==0 bugs; solve large aac 2930bytes timestamp bugs 2020-02-26 11:14:05 +08:00
winlin
bbdbcf173c For #1615, refactor the version and API for SRT. 2020-02-26 09:06:53 +08:00
winlin
04d0620dde For #1615, fix build failed and srt api issue 2020-02-25 13:45:05 +08:00
winlin
90afd06c85 For #1615, support default app(live) for vmix SRT. 4.0.9 2020-02-25 13:22:44 +08:00
winlin
771f07ee07 Merge branch 'develop' into 4.0release 2020-02-25 09:55:19 +08:00
winlin
1e998678f7
Merge pull request #1615 from runner365/3.0release.srt.dev
update streamid decode for get more encoder such as VMIX
2020-02-25 09:54:33 +08:00
runner365
0dd72e0e5b Merge branch '3.0release.srt.dev' into 3.0release 2020-02-24 12:56:01 +08:00
runner365
bbfa552140 update streamid decode for get more encoder such as VMIX 2020-02-24 12:55:17 +08:00
xiaozhihong
51abb0844e rtp session manager, stun codding 2020-02-23 23:19:40 +08:00
winlin
67d78dff0e For #1598, support SLB health checking by TCP. 4.0.8 2020-02-21 23:56:40 +08:00
winlin
ef2b123325 Merge branch '3.0release' into 4.0release 2020-02-21 23:52:04 +08:00
xiaozhihong
bc22ebe949 add rtc http request and response, exchange sdp. 2020-02-21 23:50:22 +08:00
winlin
1d01ef499d For #1579, support rolling update of k8s. 4.0.7 2020-02-20 01:06:33 +08:00
xiaozhihong
3ce5f6ce6a Merge branch 'develop' of https://github.com/ossrs/srs into develop 2020-02-19 16:40:13 +08:00
winlin
ad3cfbfd2c For #1579, support start/final wait for gracefully quit. 4.0.6 2020-02-18 23:39:40 +08:00
winlin
388ad61cdc Merge branch '3.0release' into 4.0release 2020-02-18 23:38:52 +08:00
winlin
d87f58a611 For #1579, support gracefully quit and force to. 4.0.5 2020-02-18 22:16:28 +08:00
winlin
0c48c42f36 Merge branch '3.0release' into 4.0release 2020-02-18 22:15:29 +08:00
winlin
eefd74e0e4 Merge branch '3.0release' into develop 2020-02-18 20:25:07 +08:00
xiaozhihong
7c270370b0 Merge branch 'develop' of https://github.com/ossrs/srs into develop 2020-02-17 21:49:43 +08:00
winlin
cac44ac604
Merge pull request #1611 from xialixin/develop
Fix checking the completion of one frame data in RTSP RTP stream
2020-02-17 18:46:49 +08:00
夏立新
d6e11706ec Fix disconnect RTSP connection has assertion, resulting in program exit 2020-02-17 18:46:05 +08:00
夏立新
df3ec15cd1 Fix checking the completion of one frame data in RTSP RTP stream 2020-02-17 18:08:16 +08:00
xiaozhihong
2b299a8e30 Merge branch 'develop' of https://github.com/ossrs/srs into develop 2020-02-17 15:38:26 +08:00
xiaozhihong
1c74083de8 Revert "use libco instead of state-thread(st), still have some bug"
This reverts commit 7c8a35aea9.
2020-02-17 15:30:20 +08:00
winlin
4e7e9809f3 Fix bash script bug for macOS, eventhough we don't support it. 2020-02-16 22:35:40 +08:00
xiaozhihong
7c8a35aea9 use libco instead of state-thread(st), still have some bug 2020-02-16 21:07:54 +08:00
winlin
bf45d8e23b Merge branch '3.0release' into develop 2020-02-16 14:11:42 +08:00
winlin
0723b36f0e Merge branch '3.0release' into develop 2020-02-16 13:31:54 +08:00
winlin
51d6c367f5 Merge remote-tracking branch 'runner365/3.0release' into develop 2020-02-13 17:05:18 +08:00
Alex.CR
ce4123f250
rtmp tcp listen port bugs in srt2rtmp (#1602)
* update srt2rtmp about rtmp listen tcp port

* update srt2rtmp about rtmp listen tcp port
2020-02-13 17:02:54 +08:00
runner365
94741c1676 update srt2rtmp about rtmp listen tcp port 2020-02-13 16:58:35 +08:00
runner365
76204fa2ba Merge remote-tracking branch 'srs/develop' into 3.0release 2020-02-13 16:52:47 +08:00
runner365
8e40f9cf22 update srt2rtmp about rtmp listen tcp port 2020-02-13 16:52:26 +08:00
winlin
8b7fbac7d4 SRT supports detail config for DynamicConfig. 4.0.4 2020-02-13 12:17:09 +08:00
winlin
37fdecba3c Merge remote-tracking branch 'runner365/3.0release' into develop 2020-02-13 11:06:19 +08:00
Alex.CR
9dad53691e
solve latency parameter error (#1600)
* solve latency parameter error
2020-02-13 10:54:24 +08:00
runner365
ca1efc6a34 solve merge problem 2020-02-13 10:25:13 +08:00
runner365
d8419bd4dd solve latency parameter error 2020-02-13 09:58:14 +08:00
Alex.CR
5f7d23f123
add srt parameter configure (#1599)
* if there isn't srt connect, it needn't epoll wait

* solve repush srt bugs

* change two thread to one thread

* mpegts discard header is not 0x47

* add srt_epoll_clear_usocks

* add srt parameter configure
2020-02-12 21:03:26 +08:00
runner365
24f286684e add srt parameter configure 2020-02-12 20:02:55 +08:00
Alex.CR
c2012379af
change srt epoll thread to one thread (#1597)
* if there isn't srt connect, it needn't epoll wait

* solve repush srt bugs

* change two thread to one thread

* mpegts discard header is not 0x47

* add srt_epoll_clear_usocks
2020-02-12 10:23:39 +08:00
runner365
6f4c124f58 solve merge confict 2020-02-12 10:19:30 +08:00
runner365
1a1d0e9267 add srt_epoll_clear_usocks 2020-02-12 09:54:07 +08:00
runner365
548c918efb mpegts discard header is not 0x47 2020-02-11 21:36:36 +08:00
runner365
4fdf242e99 change two thread to one thread 2020-02-11 20:37:42 +08:00
Alex.CR
3847807534
solve srt repush bugs (#1596)
* if there isn't srt connect, it needn't epoll wait

* solve repush srt bugs
2020-02-09 11:50:58 +08:00
runner365
1c6203bda2 solve repush srt bugs 2020-02-09 11:09:48 +08:00
runner365
1941f55475 if there isn't srt connect, it needn't epoll wait 2020-02-05 21:21:12 +08:00
winlin
bdc7973596 Merge branch '3.0release' into develop 2020-02-05 14:18:07 +08:00
winlin
823b4fa56f Merge branch '3.0release' into develop 2020-02-04 19:34:09 +08:00
winlin
3023dc7b40 Update project code. 4.0.3 2020-02-04 17:11:22 +08:00
winlin
55fa62e41f Update version4 2020-02-04 17:06:10 +08:00
winlin
59439cf8b5 Merge branch '3.0release' into develop 2020-02-04 17:05:19 +08:00
winlin
0621cd8c34 Merge branch '3.0release' into develop 2020-02-02 12:53:21 +08:00
winlin
fb555b4d8f Merge branch '3.0release' into develop 2020-01-29 20:31:05 +08:00
winlin
77114c7df0 Merge SRS3 2020-01-29 20:30:06 +08:00
winlin
f18cc89860 Update version 2020-01-28 21:50:08 +08:00
winlin
feca34ee59 Update version 2020-01-28 21:46:05 +08:00
winlin
6a514732b5 Update version 2020-01-28 21:45:05 +08:00
winlin
deaa0f0f15 Update version 2020-01-28 21:41:58 +08:00
winlin
6ed6ce58e4 Merge SRS3 2020-01-28 21:37:37 +08:00
winlin
b605edb9b3 Merge 3.0 2020-01-27 19:52:41 +08:00
winlin
d9bbd97d72 Allow use libsrt.so for SRT is MPL license. 2020-01-26 17:41:05 +08:00
winlin
07f4bc65c3 Merge branch '3.0release' into develop 2020-01-26 17:33:29 +08:00
Alex.CR
3615ecc092
Merge pull request #3 from ossrs/feature/srt
Refactor the hybrid model for SRT.
2020-01-26 01:01:00 -06:00
winlin
d5c1546237 Update doc for SRT 2020-01-26 14:37:59 +08:00
winlin
88c9c13707 Update readme for SRT 2020-01-26 14:17:42 +08:00
winlin
a7631a2850 Update doc 2020-01-26 12:24:02 +08:00
winlin
fd3e4f406a Update doc 2020-01-26 11:39:02 +08:00
winlin
ec3b442a42 Update doc 2020-01-26 11:29:29 +08:00
winlin
c9f3706425 Move doc 2020-01-26 11:14:18 +08:00
winlin
0453ad69ce Merge branch 'feature/srt' into develop 2020-01-25 17:25:19 +08:00
winlin
a17c1e5f65 Merge SRT from runner365 2020-01-25 17:24:25 +08:00
runner365
8d277c6e8b solve merge problem 2020-01-25 16:24:04 +08:00
runner365
dece458a90 solve rtmp client timeout bugs in srt2rtmp 2020-01-25 16:15:27 +08:00
winlin
bbc7023f85 Merge SRS3 2020-01-25 15:05:52 +08:00
winlin
5d0833fcc3 Add author runner365 2020-01-24 18:41:09 +08:00
winlin
fddfbdde5f Fix #1147, support SRT(Secure Reliable Transport). 4.0.1 2020-01-24 16:16:16 +08:00
winlin
19df3c7976 Merge branch 'srt' into develop 2020-01-24 16:11:16 +08:00
winlin
b7855d133d Merge remote-tracking branch 'runner365/3.0release.srt.dev' into srt 2020-01-24 16:11:01 +08:00
winlin
5f174552f3 Merge SRT 2020-01-24 16:10:40 +08:00
winlin
db1e06d3c9 Update README 2020-01-24 16:03:32 +08:00
winlin
e3169a080b Refactor SRT build, use libsrt.a static library 2020-01-24 07:06:30 +08:00
winlin
307a4315f1 Fix bug, should return error when wrapped 2020-01-23 21:33:59 +08:00
winlin
7c9b31815f Refactor code, add stop for hybrid server to do cleanup. 2020-01-23 21:16:34 +08:00
winlin
db5788b205 Update README for SRT 2020-01-23 20:47:32 +08:00
winlin
2363d258de Refactor hybrid server model 2020-01-23 20:42:50 +08:00
winlin
33c6bf1f8f Refactor SRT, using reverse dependency, SRT depends on APP. 2020-01-23 19:40:40 +08:00
winlin
87ba204a42 Update doc for SRT url. 2020-01-23 18:25:44 +08:00
winlin
1959d1d920 Extract hybrid server for SRT 2020-01-23 18:21:11 +08:00
winlin
225c830971 Refine main run process 2020-01-23 17:44:36 +08:00
runner365
06e7a20b5f update streamid decode 2020-01-23 17:19:06 +08:00
winlin
d88d422794 Update doc for SRT. 2020-01-23 16:49:05 +08:00
runner365
d7437834d4 update is_streamid_valid 2020-01-23 16:12:22 +08:00
Alex.CR
d792ac2e57
Merge pull request #1 from ossrs/feature/srt
Refine code before merge to SRS.
2020-01-23 01:27:44 -06:00
winlin
bc26df4893 Remove noused debug function srs_trace_data 2020-01-23 14:44:30 +08:00
winlin
aacf519169 Revert log for forwarder in source 2020-01-23 14:42:06 +08:00
winlin
a7b8695cb0 Refactor code, include without path 2020-01-23 14:33:11 +08:00
winlin
f143757429 Use macro to disable SRT in code 2020-01-23 14:23:09 +08:00
winlin
fb29096505 For SRT, allow/default disable it by --without-srt 2020-01-23 14:22:22 +08:00
winlin
fb5928f927 Fix build failed for SRT with modules. 2020-01-23 13:24:47 +08:00
winlin
2de8d788f6 Revert configure changes(srs_ingest_hls,utest) in previous commit 2020-01-23 12:32:15 +08:00
winlin
106113c5f0 For previous revert, pick some code for LibSRTRoot 2020-01-23 12:15:02 +08:00
winlin
a27c4f7095 Revert "remove modules for srt compile"
This reverts commit d4c08c44d8.
2020-01-23 12:09:54 +08:00
winlin
c7f6eef4ac Refine config file, link to issue. 2020-01-23 11:51:35 +08:00
winlin
65e8835fb5 Ignore .vscode in git. 2020-01-23 09:24:41 +08:00
winlin
d28e82962d Ignore .vscode in git. 2020-01-23 09:17:01 +08:00
winlin
abac04af6f Start developing SRS4(Leo) 2020-01-23 09:07:04 +08:00
runner365
03ef01c635 update configure 2020-01-22 10:59:50 +08:00
runner365
d4c08c44d8 remove modules for srt compile 2020-01-21 20:31:33 +08:00
runner365
746d188e6f update srt.conf 2020-01-21 19:23:38 +08:00
runner365
5c5fd805c5 add srt mpegts to rtmp 2020-01-21 19:20:09 +08:00
winlin
1b68b39d97 Merge branch '3.0release' into develop 2020-01-21 16:15:12 +08:00
runner365
7b9e3ecdc4 add ts demux 2020-01-17 19:43:54 +08:00
winlin
4a5a2db69d Merge branch '3.0release' into develop 2020-01-16 14:37:44 +08:00
runner365
1481928b53 reject repeated srt pusher connection 2020-01-15 10:30:20 +08:00
runner365
b3c3ce9bf3 rm .vscode 2020-01-14 21:11:03 +08:00
runner365
b53b75ea1e srt pull/push server 2020-01-14 21:10:33 +08:00
runner365
aeee3011ef add srt server file 2020-01-11 23:05:10 +08:00
winlin
048742f468 Merge branch '3.0release' into develop 2020-01-05 22:19:56 +08:00
winlin
e13a0c3ab4 Merge branch '3.0release' into develop 2020-01-05 17:15:29 +08:00
winlin
c107eb62ed Merge branch '3.0release' into develop 2020-01-01 21:02:25 +08:00
winlin
505f9808e4 Merge branch '3.0release' into develop 2019-12-31 19:38:06 +08:00
winlin
9c0875ceb5 Merge branch '3.0release' into develop 2019-12-30 20:51:40 +08:00
winlin
1794f805ec Merge branch '3.0release' into develop 2019-12-27 20:48:58 +08:00
winlin
801ebf6c5a Merge branch '3.0release' into develop 2019-12-26 12:32:58 +08:00
winlin
fb5a5daf19 Merge branch '3.0release' into develop 2019-12-26 12:22:46 +08:00
winlin
b8a81d8889 Merge branch '3.0release' into develop 2019-12-24 20:23:31 +08:00
winlin
a603a99b74 Merge branch '3.0release' into develop 2019-12-23 21:11:40 +08:00
winlin
fee58a8acb Merge branch '3.0release' into develop 2019-12-20 18:57:13 +08:00
winlin
94b1cf29c3 Merge branch '3.0release' into develop 2019-12-19 19:17:17 +08:00
winlin
5e57afc11e Merge branch '3.0release' into develop 2019-12-17 21:30:02 +08:00
winlin
c31c5eb05b Merge 3.0relase. 2019-12-13 11:20:26 +08:00
winlin
dad5010b2e Merge branch '3.0release' into develop 2019-12-03 19:53:00 +08:00
winlin
341d1e9aab Merge 3.0release 2019-12-03 18:28:20 +08:00
winlin
a74a586e3c Merge branch '3.0release' into develop 2019-10-28 08:50:32 +08:00
winlin
2148ef4338 Merge branch '3.0release' into develop 2019-10-22 09:01:32 +08:00
winlin
cd208bcc33 Merge branch '3.0release' into develop 2019-10-22 08:54:56 +08:00
winlin
a147d6e41e Merge 3.0release 2019-10-22 08:36:39 +08:00
winlin
a76a36a237 Merge branch '3.0release' into develop 2019-10-07 20:26:35 +08:00
winlin
c848050bb6 Merge branch '3.0release' into develop 2019-10-07 17:54:37 +08:00
winlin
2a1f8e5c1d Merge branch '3.0release' into develop 2019-10-04 19:37:57 +08:00
winlin
687bcef192 Merge branch '3.0release' into develop 2019-10-04 19:05:46 +08:00
winlin
cd27aecb07 Merge branch '3.0release' into develop 2019-10-03 13:20:19 +08:00
winlin
a14c0c8b43 Merge branch 3.0release into develop 2019-05-21 08:52:05 +08:00
winlin
57aa7de332 Merge branch 3.0release into develop 2019-05-20 09:03:38 +08:00
winlin
ab66773aae Merge branch '3.0release' into develop 2019-05-14 08:42:56 +08:00
winlin
ae710f00b1 Merge branch '3.0release' into develop 2019-05-13 08:50:19 +08:00
winlin
5c8ef7c005 Update readme. 2019-05-07 08:28:06 +08:00
winlin
89f85dc463 Update readme 2019-05-07 08:00:16 +08:00
winlin
3835661b8d Update readme 2019-05-07 07:58:25 +08:00
winlin
b18f0c6118 Merge branch '3.0release' into develop 2019-05-07 07:40:29 +08:00
winlin
7c002308e9 Merge branch 3.0release into develop 2019-05-05 07:59:15 +08:00
winlin
cf00bb7606 Merge branch 3.0release into develop 2019-04-22 08:12:26 +08:00
winlin
a5babfe080 Merge branch 3.0release into develop 2019-04-14 23:35:11 +00:00
winlin
f73a17eac3 Merge branch 3.0release into develop 2019-04-06 16:11:18 +08:00
winlin
128dc67776 Merge branch 3.0release into develop 2019-04-06 15:42:39 +08:00
winlin
85db08cef9 Merge branch 3.0release into develop 2019-04-05 18:49:34 +08:00
winlin
75b3ca9456 Update readme 2019-02-11 11:35:00 +08:00
winlin
9f10f890cf Merge 3.0release 2019-02-11 11:12:39 +08:00
winlin
5ca2a0649a Merge branch '3.0release' into develop 2019-02-02 20:24:39 +08:00
winlin
15f75ffb22 CI: Update badges 2019-02-02 20:13:26 +08:00
5707 changed files with 1751096 additions and 143102 deletions

View file

@ -1,20 +0,0 @@
version: 2
jobs:
build:
docker:
- image: ossrs/srs:dev
steps:
- checkout
- run: cd trunk && ./configure --with-utest && make
test:
docker:
- image: ossrs/srs:dev
steps:
- checkout
- run: cd trunk && ./configure --with-utest --gcov && make && ./objs/srs_utest && bash auto/coverage.sh
workflows:
version: 2
build_and_test:
jobs:
- build
- test

12
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with patreon id.
open_collective: srs-server
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View file

@ -1,34 +0,0 @@
---
name: File bug
about: File bug to improve SRS
title: ''
labels: ''
assignees: ''
---
**描述(Description)**
> 描述你遇到了什么问题(Please description your issue here)
1. SRS版本(Version): `xxxxxx`
1. SRS的日志如下(Log):
```
xxxxxxxxxxxx
```
1. SRS的配置如下(Config):
```
xxxxxxxxxxxx
```
**重现(Replay)**
> 重现Bug的步骤(How to replay bug?)
1. `xxxxxx`
1. `xxxxxx`
1. `xxxxxx`
**期望行为(Expect)**
> 描述你期望发生的事情(Please describe your expectation)

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
!!! Before submitting a new bug report, please ensure you have searched for any existing bugs and utilized
the `Ask AI` feature at https://ossrs.io or https://ossrs.net (for users in China). Duplicate issues or
questions that are overly simple or already addressed in the documentation will be removed without any
response.
**Describe the bug**
A clear and concise description of what the bug is.
**Version**
Desribe your SRS Server version here.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''
---
!!! Before submitting a new feature request, please ensure you have searched for any existing features and utilized
the `Ask AI` feature at https://ossrs.io or https://ossrs.net (for users in China). Duplicate issues or
questions that are overly simple or already addressed in the documentation will be removed without any
response.
**What is the business background? Please provide a description.**
Who are the users? How do they utilize this feature? What problem does this feature address?
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

37
.github/workflows/codeql-analysis.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: "CodeQL"
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
on: [push, pull_request]
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions: write-all
jobs:
analyze:
name: actions-codeql-analyze
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@515828d97454b8354517688ddc5b48402b723750 # v2.1.38
with:
languages: ${{ matrix.language }}
- name: Build SRS
run: |
echo "pwd: $(pwd), who: $(whoami)"
docker run --rm -v $(pwd):$(pwd) -w $(pwd)/trunk ossrs/srs:ubuntu20-cache \
bash -c "./configure && chmod 777 -R objs"
cd trunk && ./configure && make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@515828d97454b8354517688ddc5b48402b723750 # v2.1.38

480
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,480 @@
name: "Release"
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
on:
push:
tags:
- v6*
# For draft, need write permission.
permissions:
contents: write
jobs:
envs:
name: envs
steps:
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# The github.ref is, for example, refs/tags/v6.0.145 or refs/tags/v6.0-r8
# Generate variables like:
# SRS_TAG=v6.0-r8
# SRS_TAG=v6.0.145
# SRS_VERSION=6.0.145
# SRS_VERSION=6.0-r8
# SRS_MAJOR=6
# SRS_XYZ=6.0.145
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Generate varaiables
run: |
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}')
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV
SRS_VERSION=$(echo ${SRS_TAG}| sed 's/^v//g')
echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2)
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV
VFILE="trunk/src/core/srs_core_version6.hpp"
SRS_X=$(cat $VFILE |grep VERSION_MAJOR |awk '{print $3}')
SRS_Y=$(cat $VFILE |grep VERSION_MINOR |awk '{print $3}')
SRS_Z=$(cat $VFILE |grep VERSION_REVISION |awk '{print $3}')
SRS_XYZ=$SRS_X.$SRS_Y.$SRS_Z
echo "SRS_XYZ=$SRS_XYZ" >> $GITHUB_ENV
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
SRS_TAG: ${{ env.SRS_TAG }}
SRS_VERSION: ${{ env.SRS_VERSION }}
SRS_MAJOR: ${{ env.SRS_MAJOR }}
SRS_XYZ: ${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04
test:
name: test
needs:
- envs
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
# Tests
- name: Build test image
run: docker build --tag srs:test -f trunk/Dockerfile.test .
# For utest
- name: Run SRS utest
run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest'
# For regression-test
- name: Run SRS regression-test
run: |
docker run --rm srs:test bash -c 'make && \
./objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
runs-on: ubuntu-20.04
draft:
name: draft
needs:
- envs
steps:
- name: Create release draft
id: create_draft
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: true
tag: ${{ github.ref }}
draft: true
prerelease: true
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
SRS_RELEASE_ID: ${{ steps.create_draft.outputs.id }}
runs-on: ubuntu-20.04
cygwin64:
name: cygwin64
needs:
- envs
- draft
steps:
# See https://github.com/cygwin/cygwin-install-action#parameters
# Note that https://github.com/egor-tensin/setup-cygwin fails to install packages.
- name: Setup Cygwin
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # master
with:
platform: x86_64
packages: bash make gcc-g++ cmake automake patch pkg-config tcl unzip
install-dir: C:\cygwin64
##################################################################################################################
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
- name: Covert output to env
env:
SHELLOPTS: igncr
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV
##################################################################################################################
- name: Build SRS
env:
SHELLOPTS: igncr
SRS_WORKSPACE: ${{ github.workspace }}
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
export PATH=/usr/bin:/usr/local/bin &&
which make gcc g++ patch cmake pkg-config uname grep sed &&
(make --version; gcc --version; patch --version; cmake --version; pkg-config --version) &&
(aclocal --version; autoconf --version; automake --version; uname -a) &&
cd $(cygpath -u $SRS_WORKSPACE)/trunk && ./configure --gb28181=on --h265=on && make
##################################################################################################################
- name: Package SRS
env:
SHELLOPTS: igncr
SRS_WORKSPACE: ${{ github.workspace }}
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
cd $(cygpath -u $SRS_WORKSPACE) &&
if [[ $(echo $SRS_TAG |grep -qE '^v' && echo YES) != YES ]]; then
SRS_VERSION=$(./trunk/objs/srs -v 2>&1); echo "Change version to ${SRS_VERSION}";
fi &&
"/cygdrive/c/Program Files (x86)/NSIS/makensis.exe" /DSRS_VERSION=${SRS_VERSION} \
/DCYGWIN_DIR="C:\cygwin64" trunk/packaging/nsis/srs.nsi &&
mv trunk/packaging/nsis/SRS-Windows-x86_64-${SRS_VERSION}-setup.exe . && ls -lh *.exe &&
echo "SRS_CYGWIN_TAR=SRS-Windows-x86_64-${SRS_VERSION}-setup.exe" >> $GITHUB_ENV &&
echo "SRS_CYGWIN_MD5=$(md5sum SRS-Windows-x86_64-${SRS_VERSION}-setup.exe| awk '{print $1}')" >> $GITHUB_ENV
##################################################################################################################
- name: Upload Release Assets Cygwin
id: upload-release-assets-cygwin
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_CYGWIN_TAR }}
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
SRS_CYGWIN_TAR: ${{ env.SRS_CYGWIN_TAR }}
SRS_CYGWIN_MD5: ${{ env.SRS_CYGWIN_MD5 }}
runs-on: windows-latest
linux:
name: linux
needs:
- envs
- draft
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
# Create source tar for release. Note that it's for OpenWRT package srs-server, so the filename MUST be
# srs-server-xxx.tar.gz, because the package is named srs-server.
# Generate variables like:
# SRS_SOURCE_TAR=srs-server-6.0.145.tar.gz
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
- name: Create source tar.gz
run: |
DEST_DIR=srs-server-$SRS_VERSION && mkdir -p $DEST_DIR &&
cp README.md $DEST_DIR && cp LICENSE $DEST_DIR && cp -R trunk $DEST_DIR/trunk &&
(cd $DEST_DIR/trunk/3rdparty && rm -rf *.zip openssl-*.gz srs-bench) &&
tar zcf ${DEST_DIR}.tar.gz ${DEST_DIR} && du -sh ${DEST_DIR}* && rm -rf ${DEST_DIR} &&
echo "SRS_SOURCE_TAR=${DEST_DIR}.tar.gz" >> $GITHUB_ENV &&
echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.tar.gz| awk '{print $1}')" >> $GITHUB_ENV
# Create package tar for release
# Generate variables like:
# SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-6.0.145.zip
# SRS_PACKAGE_MD5=3880a26e30b283edf05700a4e69956e5
- name: Create package zip
env:
PACKAGER: ${{ secrets.SRS_PACKAGER_BINARY }}
run: |
docker build --tag srs:pkg --build-arg version=$SRS_VERSION --build-arg SRS_AUTO_PACKAGER=$PACKAGER -f trunk/Dockerfile.pkg . &&
SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-$SRS_VERSION.zip &&
docker run --rm -v $(pwd):/output srs:pkg cp objs/$SRS_PACKAGE_ZIP /output/ &&
du -sh $SRS_PACKAGE_ZIP &&
echo "SRS_PACKAGE_ZIP=$SRS_PACKAGE_ZIP" >> $GITHUB_ENV &&
echo "SRS_PACKAGE_MD5=$(md5sum $SRS_PACKAGE_ZIP| awk '{print $1}')" >> $GITHUB_ENV
##################################################################################################################
- name: Upload Release Assets Packager
id: upload-release-assets-packager
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_PACKAGE_ZIP }}
- name: Upload Release Assets Source
id: upload-release-assets-source
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ env.SRS_RELEASE_ID }}
assets_path: ${{ env.SRS_SOURCE_TAR }}
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
SRS_PACKAGE_ZIP: ${{ env.SRS_PACKAGE_ZIP }}
SRS_PACKAGE_MD5: ${{ env.SRS_PACKAGE_MD5 }}
SRS_SOURCE_TAR: ${{ env.SRS_SOURCE_TAR }}
SRS_SOURCE_MD5: ${{ env.SRS_SOURCE_MD5 }}
runs-on: ubuntu-20.04
docker-srs:
name: docker-srs
needs:
- envs
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_XYZ=${{ needs.envs.outputs.SRS_XYZ }}" >> $GITHUB_ENV
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
##################################################################################################################
# Create main images for Docker
- name: Login to docker hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Build and push images to Docker hub
env:
PACKAGER: ${{ secrets.SRS_PACKAGER_DOCKER }}
run: |
echo "Release ossrs/srs:$SRS_TAG"
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--output "type=image,push=true" \
-t ossrs/srs:$SRS_TAG --build-arg SRS_AUTO_PACKAGER=$PACKAGER \
--build-arg CONFARGS='--sanitizer=off --gb28181=on' \
-f Dockerfile .
# Docker alias images
# TODO: FIXME: If stable, please set the latest from 5.0 to 6.0
- name: Docker alias images for ossrs/srs
uses: akhilerm/tag-push-action@85bf542f43f5f2060ef76262a67ee3607cb6db37 # v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}
dst: |
ossrs/srs:${{ env.SRS_VERSION }}
ossrs/srs:${{ env.SRS_MAJOR }}
ossrs/srs:v${{ env.SRS_MAJOR }}
ossrs/srs:${{ env.SRS_XYZ }}
ossrs/srs:v${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04
aliyun-srs:
name: aliyun-srs
needs:
- envs
- docker-srs
- test
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_XYZ=${{ needs.envs.outputs.SRS_XYZ }}" >> $GITHUB_ENV
# Aliyun ACR
# TODO: FIXME: If stable, please set the latest from 5.0 to 6.0
- name: Login aliyun hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: "${{ secrets.ACR_USERNAME }}"
password: "${{ secrets.ACR_PASSWORD }}"
- name: Push to Aliyun registry for ossrs/srs
uses: akhilerm/tag-push-action@85bf542f43f5f2060ef76262a67ee3607cb6db37 # v2.1.0
with:
src: ossrs/srs:${{ env.SRS_TAG }}
dst: |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_VERSION }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_MAJOR }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }}
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v${{ env.SRS_XYZ }}
runs-on: ubuntu-20.04
update:
name: update
needs:
- aliyun-srs
- envs
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
# Generate variables like:
# SRS_LH_OSSRS_NET=1.2.3.4
- name: Build variables for lh.ossrs.net
run: |
SRS_LH_OSSRS_NET=$(dig +short lh.ossrs.net)
SRS_D_OSSRS_NET=$(dig +short d.ossrs.net)
echo "SRS_LH_OSSRS_NET=$SRS_LH_OSSRS_NET" >> $GITHUB_ENV
echo "SRS_D_OSSRS_NET=$SRS_D_OSSRS_NET" >> $GITHUB_ENV
- name: Release to lh.ossrs.net
uses: appleboy/ssh-action@c1965ddd2563844fddc1ec01cafc798365706143 # master
with:
host: ${{ env.SRS_LH_OSSRS_NET }}
username: root
key: ${{ secrets.DIGITALOCEAN_SSHKEY }}
port: 22
envs: SRS_MAJOR
timeout: 60s
command_timeout: 30m
script: |
docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_MAJOR
docker rm -f srs-dev
#
# Cleanup old docker images.
for image in $(docker images |grep '<none>' |awk '{print $3}'); do
docker rmi -f $image
echo "Remove image $image, r0=$?"
done
- name: Release to d.ossrs.net
uses: appleboy/ssh-action@c1965ddd2563844fddc1ec01cafc798365706143 # master
with:
host: ${{ env.SRS_D_OSSRS_NET }}
username: root
key: ${{ secrets.DIGITALOCEAN_SSHKEY }}
port: 22
envs: SRS_MAJOR
timeout: 60s
command_timeout: 30m
script: |
docker pull ossrs/srs:$SRS_MAJOR
docker rm -f srs-dev
#
# Cleanup old docker images.
for image in $(docker images |grep '<none>' |awk '{print $3}'); do
docker rmi -f $image
echo "Remove image $image, r0=$?"
done
runs-on: ubuntu-20.04
release:
name: release
needs:
- update
- envs
- draft
- cygwin64
- linux
steps:
##################################################################################################################
- name: Covert output to env
run: |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV
echo "SRS_VERSION=${{ needs.envs.outputs.SRS_VERSION }}" >> $GITHUB_ENV
echo "SRS_MAJOR=${{ needs.envs.outputs.SRS_MAJOR }}" >> $GITHUB_ENV
echo "SRS_RELEASE_ID=${{ needs.draft.outputs.SRS_RELEASE_ID }}" >> $GITHUB_ENV
echo "SRS_PACKAGE_ZIP=${{ needs.linux.outputs.SRS_PACKAGE_ZIP }}" >> $GITHUB_ENV
echo "SRS_PACKAGE_MD5=${{ needs.linux.outputs.SRS_PACKAGE_MD5 }}" >> $GITHUB_ENV
echo "SRS_SOURCE_TAR=${{ needs.linux.outputs.SRS_SOURCE_TAR }}" >> $GITHUB_ENV
echo "SRS_SOURCE_MD5=${{ needs.linux.outputs.SRS_SOURCE_MD5 }}" >> $GITHUB_ENV
echo "SRS_CYGWIN_TAR=${{ needs.cygwin64.outputs.SRS_CYGWIN_TAR }}" >> $GITHUB_ENV
echo "SRS_CYGWIN_MD5=${{ needs.cygwin64.outputs.SRS_CYGWIN_MD5 }}" >> $GITHUB_ENV
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Create release.
# TODO: FIXME: Refine the release when 6.0 released
# TODO: FIXME: Change prerelease to false and makeLatest to true when 6.0 released
- name: Update release
id: update_release
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: true
tag: ${{ github.ref }}
name: Release ${{ env.SRS_TAG }}
body: |
If you would like to support SRS, please consider contributing to our [OpenCollective](https://opencollective.com/srs-server).
[${{ github.sha }}](https://github.com/ossrs/srs/commit/${{ github.sha }})
${{ github.event.head_commit.message }}
## Resource
* Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
* Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }})
* Binary: ${{ env.SRS_CYGWIN_MD5 }} [${{ env.SRS_CYGWIN_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_CYGWIN_TAR }})
## Resource Mirror: gitee.com
* Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
* Binary: ${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }})
* Binary: ${{ env.SRS_CYGWIN_MD5 }} [${{ env.SRS_CYGWIN_TAR }}](https://gitee.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_CYGWIN_TAR }})
## Docker
* [docker pull ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started)
* [docker pull ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started)
* [docker pull ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started)
## Docker Mirror: aliyun.com
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_MAJOR }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started)
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started)
* [docker pull registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_XYZ }}](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started)
## Doc: ossrs.io
* [Getting Started](https://ossrs.io/lts/en-us/docs/v5/doc/getting-started)
* [Wiki home](https://ossrs.io/lts/en-us/docs/v5/doc/introduction)
* [FAQ](https://ossrs.io/lts/en-us/faq), [Features](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) or [ChangeLogs](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog)
## Doc: ossrs.net
* [快速入门](https://ossrs.net/lts/zh-cn/docs/v5/doc/getting-started)
* [中文Wiki首页](https://ossrs.net/lts/zh-cn/docs/v5/doc/introduction)
* [中文FAQ](https://ossrs.net/lts/zh-cn/faq), [功能列表](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/Features.md#features) 或 [修订历史](https://github.com/ossrs/srs/blob/${{ github.sha }}/trunk/doc/CHANGELOG.md#changelog)
draft: false
prerelease: true
makeLatest: false
runs-on: ubuntu-20.04
release-done:
runs-on: ubuntu-20.04
needs:
- update
- release
steps:
- run: echo 'All done'

327
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,327 @@
name: "Test"
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
on: [push, pull_request]
# Declare default permissions as read only.
permissions: read-all
# The dependency graph:
# test(6m)
# multiple-arch-armv7(13m)
# multiple-arch-aarch64(7m)
# cygwin64-cache(1m)
# cygwin64(6m) - Must depends on cygwin64-cache.
# fast(0s) - To limit all fastly run jobs after slow jobs.
# build-centos7(3m)
# build-ubuntu16(3m)
# build-ubuntu18(2m)
# build-ubuntu20(2m)
# build-cross-arm(3m)
# build-cross-aarch64(3m)
# multiple-arch-amd64(2m)
# coverage(3m)
jobs:
cygwin64-cache:
name: cygwin64-cache
steps:
- name: Download Cache for Cygwin
run: |
echo "Generate convert.sh" &&
echo "for file in \$(find objs -type l); do" > convert.sh &&
echo " REAL=\$(readlink -f \$file) &&" >> convert.sh &&
echo " echo \"convert \$file to \$REAL\" &&" >> convert.sh &&
echo " rm -rf \$file &&" >> convert.sh &&
echo " cp -r \$REAL \$file" >> convert.sh &&
echo "done" >> convert.sh &&
cat convert.sh &&
docker run --rm -v $(pwd):/srs -w /usr/local/srs-cache/srs/trunk ossrs/srs:cygwin64-cache \
bash -c "bash /srs/convert.sh && tar cf /srs/objs.tar.bz2 objs" &&
pwd && du -sh *
##################################################################################################################
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: srs-cache
path: objs.tar.bz2
retention-days: 1
runs-on: ubuntu-20.04
cygwin64:
name: cygwin64
needs:
- cygwin64-cache
steps:
# See https://github.com/cygwin/cygwin-install-action#parameters
# Note that https://github.com/egor-tensin/setup-cygwin fails to install packages.
- name: Setup Cygwin
uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # master
with:
platform: x86_64
packages: bash make gcc-g++ cmake automake patch pkg-config tcl unzip
install-dir: C:\cygwin64
##################################################################################################################
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
##################################################################################################################
# Note that we must download artifact after checkout code, because it will change the files in workspace.
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: srs-cache
- uses: geekyeggo/delete-artifact@54ab544f12cdb7b71613a16a2b5a37a9ade990af # v2.0.0
with:
name: srs-cache
##################################################################################################################
- name: Build and test SRS
env:
SHELLOPTS: igncr
SRS_WORKSPACE: ${{ github.workspace }}
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
WORKDIR=$(cygpath -u $SRS_WORKSPACE) && export PATH=/usr/bin:/usr/local/bin && cd ${WORKDIR} &&
pwd && rm -rf /usr/local/srs-cache && mkdir -p /usr/local/srs-cache/srs/trunk && ls -lh &&
tar xf objs.tar.bz2 -C /usr/local/srs-cache/srs/trunk/ && du -sh /usr/local/srs-cache/srs/trunk/* &&
cd ${WORKDIR}/trunk && ./configure --h265=on --gb28181=on --utest=on && ls -lh && du -sh * && du -sh objs/* &&
cd ${WORKDIR}/trunk && make utest && ./objs/srs_utest
runs-on: windows-latest
build-centos7:
name: build-centos7
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Build for CentOS 7
- name: Build on CentOS7, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-baseline .
- name: Build on CentOS7, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-all .
- name: Build on CentOS7, without WebRTC
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-webrtc .
- name: Build on CentOS7, without ASM
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-asm .
- name: Build on CentOS7, C++98, no FFmpeg
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-ansi-no-ffmpeg .
runs-on: ubuntu-20.04
build-ubuntu16:
name: build-ubuntu16
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Build for Ubuntu16
- name: Build on Ubuntu16, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-baseline .
- name: Build on Ubuntu16, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-all .
runs-on: ubuntu-20.04
build-ubuntu18:
name: build-ubuntu18
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Build for Ubuntu18
- name: Build on Ubuntu18, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-baseline .
- name: Build on Ubuntu18, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-all .
runs-on: ubuntu-20.04
build-ubuntu20:
name: build-ubuntu20
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Build for Ubuntu20
- name: Build on Ubuntu20, baseline
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-baseline .
- name: Build on Ubuntu20, with all features
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-all .
runs-on: ubuntu-20.04
build-cross-arm:
name: build-cross-arm
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Cross Build for ARMv7 on Ubuntu16
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-armv7 .
- name: Cross Build for ARMv7 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-armv7 .
runs-on: ubuntu-20.04
build-cross-aarch64:
name: build-cross-aarch64
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Cross Build for AARCH64 on Ubuntu16
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cache-cross-aarch64 .
- name: Cross Build for AARCH64 on Ubuntu20
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cache-cross-aarch64 .
runs-on: ubuntu-20.04
test:
name: utest-regression-blackbox-test
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Tests
- name: Build test image
run: docker build --tag srs:test --build-arg MAKEARGS='-j2' -f trunk/Dockerfile.test .
# For blackbox-test
- name: Run SRS blackbox-test
run: |
#docker run --rm -w /srs/trunk/3rdparty/srs-bench srs:test ./objs/srs_blackbox_test -test.v \
# -test.run 'TestFast_RtmpPublish_DvrFlv_Basic' -srs-log -srs-stdout srs-ffmpeg-stderr -srs-dvr-stderr \
# -srs-ffprobe-stdout
docker run --rm -w /srs/trunk/3rdparty/srs-bench srs:test \
./objs/srs_blackbox_test -test.v -test.run '^TestFast' -test.parallel 64
docker run --rm -w /srs/trunk/3rdparty/srs-bench srs:test \
./objs/srs_blackbox_test -test.v -test.run '^TestSlow' -test.parallel 1
# For utest
- name: Run SRS utest
run: docker run --rm srs:test ./objs/srs_utest
# For regression-test
- name: Run SRS regression-test
run: |
docker run --rm srs:test bash -c './objs/srs -c conf/regression-test.conf && \
cd 3rdparty/srs-bench && (./objs/srs_test -test.v || (cat ../../objs/srs.log && exit 1)) && \
./objs/srs_gb28181_test -test.v'
runs-on: ubuntu-20.04
coverage:
name: coverage
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# Tests
- name: Build coverage image
run: docker build --tag srs:cov --build-arg MAKEARGS='-j2' -f trunk/Dockerfile.cov .
# For coverage
- name: Run SRS covergae
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/pull/') }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
# The hash of commit.
SRS_SHA=${{ github.sha }}
# Note that the root of SRS, must contains .git, for report fixing.
SRS_PROJECT=/srs
# The github.ref is, for example, refs/heads/develop
SRS_BRANCH=$(echo ${{ github.ref }}| awk -F 'refs/heads/' '{print $2}'| awk -F '/' '{print $1}')
# The github.ref is, for example, refs/pull/2536/merge
SRS_PR=$(echo ${{ github.ref }}| awk -F 'refs/pull/' '{print $2}'| awk -F '/' '{print $1}')
#
echo "For github.ref=${{ github.ref }}, github.sha=${{ github.sha }}"
echo "SRS_BRANCH=$SRS_BRANCH, SRS_PR=$SRS_PR, SRS_SHA=$SRS_SHA, SRS_PROJECT=$SRS_PROJECT"
docker run --rm --env CODECOV_TOKEN=$CODECOV_TOKEN --env SRS_BRANCH=$SRS_BRANCH \
--env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
srs:cov bash -c './objs/srs_utest && bash auto/codecov.sh'
#
runs-on: ubuntu-20.04
multiple-arch-armv7:
name: multiple-arch-armv7
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build multiple archs image
run: |
docker buildx build --platform linux/arm/v7 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \
-f Dockerfile .
runs-on: ubuntu-20.04
multiple-arch-aarch64:
name: multiple-arch-aarch64
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build multiple archs image
run: |
docker buildx build --platform linux/arm64/v8 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
--build-arg INSTALLDEPENDS="NO" \
-f Dockerfile .
runs-on: ubuntu-20.04
multiple-arch-amd64:
name: multiple-arch-amd64
needs:
- fast
steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Build multiple archs image
run: |
docker buildx build --platform linux/amd64 \
--output "type=image,push=false" \
--build-arg IMAGE=ossrs/srs:ubuntu20-cache \
-f Dockerfile .
runs-on: ubuntu-20.04
fast:
name: fast
needs:
- cygwin64-cache
steps:
- run: echo 'Start fast jobs'
runs-on: ubuntu-20.04
test-done:
needs:
- cygwin64
- coverage
- test
- build-centos7
- build-ubuntu16
- build-ubuntu18
- build-ubuntu20
- build-cross-arm
- build-cross-aarch64
- multiple-arch-armv7
- multiple-arch-aarch64
- multiple-arch-amd64
runs-on: ubuntu-20.04
steps:
- run: echo 'All done'

12
.gitignore vendored
View file

@ -16,13 +16,14 @@
*.pyc
*.swp
.DS_Store
.vscode
.vscode/*
/trunk/Makefile
/trunk/objs
/trunk/src/build-qt-Desktop-Debug
/trunk/research/librtmp/objs
/trunk/3rdparty/ccache/ccache-3.1.9
/trunk/3rdparty/gprof/graphviz-2.36.0
/trunk/research/api-server/static-dir/crossdomain.xml
/trunk/research/api-server/static-dir/forward
/trunk/research/api-server/static-dir/live
/trunk/research/api-server/static-dir/players
@ -32,4 +33,13 @@
.idea
.DS_Store
*.heap
*.exe
cmake-build-debug
/trunk/ide/srs_clion/CMakeCache.txt
/trunk/ide/srs_clion/CMakeFiles
/trunk/ide/srs_clion/Makefile
/trunk/ide/srs_clion/cmake_install.cmake
/trunk/ide/srs_clion/srs
/trunk/ide/srs_clion/Testing/

12
.run/env.run.xml Normal file
View file

@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="env" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<envs>
<env name="SRS_ENV_ONLY" value="on" />
<env name="SRS_LISTEN" value="1935" />
<env name="SRS_EXPORTER_ENABLED" value="on" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/gb28181.run.xml Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="gb28181" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/gb28181.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/ingest.run.xml Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ingest" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/clion-ingest.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

11
.run/private.run.xml Normal file
View file

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="private" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c console.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<envs>
<env name="SRS_RTC_SERVER_ENABLED" value="on" />
<env name="MallocNanoZone" value="0" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="regression-test" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/regression-test-for-clion.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

11
.run/srs-stack.run.xml Normal file
View file

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="srs-stack" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c containers/conf/srs.release-local.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$USER_HOME$/git/srs-stack/platform" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<envs>
<env name="SRS_RTC_SERVER_ENABLED" value="on" />
<env name="MallocNanoZone" value="0" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/srs.run.xml Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="srs" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/clion.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/srt.run.xml Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="srt" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="-c conf/clion-srt.conf" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="srs" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="srs">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/utest.run.xml Normal file
View file

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="utest" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" WORKING_DIR="file://$CMakeCurrentBuildDir$/../../../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="srs" TARGET_NAME="utest" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="srs" RUN_TARGET_NAME="utest">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View file

@ -1,57 +0,0 @@
CONTRIBUTORS ordered by first contribution.
* winlin<winlin@vip.126.com>
* wenjie.zhao<740936897@qq.com>
* xiangcheng.liu<liuxc0116@foxmail.com>
* naijia.liu<youngcow@youngcow.net>
* alcoholyi<alcoholyi@qq.com>
* byteman<wangchen2011@gmail.com>
* chad.wang<chad.wang.cn@gmail.com>
* suhetao<suhetao@gmail.com>
* Johnny<fengjihu@163.com>
* karthikeyan<keyanmca@gmail.com>
* StevenLiu<lq@chinaffmpeg.org>
* zhengfl<zhengfl_1989@126.com>
* tufang14<breadbean1449@gmail.com>
* allspace<allspace@gmail.com>
* niesongsong<nie950@gmail.com>
* rudeb0t<nimrod@themanxgroup.tw>
* CallMeNP<np.liamg@gmail.com>
* synote<synote@qq.com>
* lovecat<littlefawn@163.com>
* panda1986<542638787@qq.com>
* YueHonghui<hongf.yue@hotmail.com>
* ThomasDreibholz<dreibh@simula.no>
* JuntaoLiu<juntliu@gmail.com>
* RocFang<fangpeng1986@gmail.com>
* MakarovYaroslav<yaroslav.makarov.97@mail.ru>
* MirkoVelic<mvelic@inoxx.net>
* HuiZhang(huzhang2)<huzhang2@cisco.com>
* OtterWa<simpleotter23@gmail.com>
* walkermi<172192667@qq.com>
* haofz<fuzhuang.hao@vhall.com>
* ME_Kun_Han<hanvskun@hotmail.com>
* ljx0305<ljx0305@gmail.com>
* cenxinwei<censhanhe@163.com>
* StarBrilliant<m13253@hotmail.com>
* xubin<xubin@chnvideo.com>
* intliang<yintiliang@gmail.com>
* flowerwrong<sysuyangkang@gmail.com>
* YLX<568414379@qq.com>
* J<guotaojiang@qq.com>
* Harlan<hailiang@gvrcraft.com>
* hankun<hankun@bravovcloud.com>
* JonathanBarratt<jonathan.barratt@gmail.com>
* KeeganH<keeganwharris@gmail.com>
* StevenLiu<lingjiujianke@gmail.com>
* liuxc0116<liuxc0116@gmail.com>
* ChengdongZhang<lmajzcd@sina.com>
* lovacat<lovecat@china.sina.com>
* qiang.li<qiang.li@verycdn.com.cn>
* HungMingWu<u9089000@gmail.com>
* Himer<xishizhaohua@qq.com>
* xialixin<xlx0625@163.com>
* alphonsetai<tyh_123@163.com>
* Michael.Ma<wnpllr@gmail.com>
* lam2003<linmin3@yy.com>
* l<22312935+lam2003@users.noreply.github.com>
* xfalcon<x-falcon@users.noreply.github.com>

15
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,15 @@
Welome to contribute to SRS!
1. Please start from fixing some [Issues: good first issue](https://github.com/ossrs/srs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
1. Please [setup your email](https://ossrs.io/lts/en-us/how-to-file-pr#setup-your-email) before contributing, this is important.
1. Then follow the [guide](https://ossrs.io/lts/en-us/how-to-file-pr) or [贡献代码](https://ossrs.net/lts/zh-cn/how-to-file-pr) to file a PR.
1. We will review your PR ASAP.
If achieve [50 commits](https://github.com/ossrs/srs/graphs/contributors), you will be [TOC of SRS](https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#toc).
* The update of this file MUST be approved by [Winlin](https://github.com/winlinvip) and 3+ [TOC](https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#toc).
* Each [PullRequest](https://github.com/ossrs/srs/pulls) MUST be approved by 2+ [TOC](https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#toc) or [Developers](https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#developers).
* The name of TOC will be listed at [README](https://github.com/ossrs/srs#authors) forever.
All [contributors](https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors) are listed in SRS authors.

61
Dockerfile Normal file
View file

@ -0,0 +1,61 @@
ARG ARCH
ARG IMAGE=ossrs/srs:ubuntu20
FROM ${ARCH}${IMAGE} AS build
ARG CONFARGS
ARG MAKEARGS
ARG INSTALLDEPENDS
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG SRS_AUTO_PACKAGER
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, PACKAGER: ${#SRS_AUTO_PACKAGER}, CONFARGS: ${CONFARGS}, MAKEARGS: ${MAKEARGS}, INSTALLDEPENDS: ${INSTALLDEPENDS}"
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
ENV DEBIAN_FRONTEND noninteractive
# To use if in RUN, see https://github.com/moby/moby/issues/7281#issuecomment-389440503
# Note that only exists issue like "/bin/sh: 1: [[: not found" for Ubuntu20, no such problem in CentOS7.
SHELL ["/bin/bash", "-c"]
# Install depends tools.
RUN if [[ $INSTALLDEPENDS != 'NO' ]]; then \
apt-get update && apt-get install -y gcc make g++ patch unzip perl git libasan5; \
fi
# Copy source code to docker.
COPY . /srs
WORKDIR /srs/trunk
# Build and install SRS.
# Note that SRT is enabled by default, so we configure without --srt=on.
# Note that we have copied all files by make install.
RUN ./configure ${CONFARGS} && make ${MAKEARGS} && make install
############################################################
# dist
############################################################
FROM ${ARCH}ubuntu:focal AS dist
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM"
# Expose ports for streaming @see https://github.com/ossrs/srs#ports
EXPOSE 1935 1985 8080 5060 9000 8000/udp 10080/udp
# FFMPEG 4.1
COPY --from=build /usr/local/bin/ffmpeg /usr/local/srs/objs/ffmpeg/bin/ffmpeg
# SRS binary, config files and srs-console.
COPY --from=build /usr/local/srs /usr/local/srs
# Test the version of binaries.
RUN ldd /usr/local/srs/objs/ffmpeg/bin/ffmpeg && \
/usr/local/srs/objs/ffmpeg/bin/ffmpeg -version && \
ldd /usr/local/srs/objs/srs && \
/usr/local/srs/objs/srs -v
# Default workdir and command.
WORKDIR /usr/local/srs
ENV SRS_DAEMON=off SRS_IN_DOCKER=on
CMD ["./objs/srs", "-c", "conf/docker.conf"]

View file

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2013-2020 Winlin
Copyright (c) 2013-2024 The SRS Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@ -17,5 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1874
README.md

File diff suppressed because it is too large Load diff

8
SECURITY.md Normal file
View file

@ -0,0 +1,8 @@
# Security Policy
We appreciate work to discover security vulnerabilities, but as SRS is entirely volunteer driven,
so we might not be able to respond to issues in time.
Please click [here](https://github.com/ossrs/srs/security/advisories) to report a vulnerability.

14
trunk/.gitignore vendored
View file

@ -13,6 +13,7 @@
/ide/srs_xcode/srs_xcode.xcodeproj/xcuserdata/
/research/aac/
/research/api-server/static-dir/mse
/research/api-server/static-dir/crossdomain.xml
/research/bat/
/research/big/
/research/bitch/
@ -34,11 +35,20 @@
/research/speex/
/test/
.DS_Store
srs
./srs
*.dSYM/
*.gcov
*.gcno
*.ts
*.h264
*.264
3rdparty/ffmpeg-4.2-fit
/webrtc
/configure.sh
/janus
*.dump
bug
/research/thread-model/thread-local
*.gcp
*.svg
/3rdparty/st-srs/srs
/3rdparty/st-srs/.circleci

Binary file not shown.

70
trunk/3rdparty/README.md vendored Normal file
View file

@ -0,0 +1,70 @@
http-parser-2.1.zip
* for srs to support http callback.
* https://github.com/nodejs/http-parser
* https://github.com/ossrs/http-parser
* https://ossrs.net/lts/zh-cn/license#http-parser
nginx-1.5.7.zip
* http://nginx.org/
* for srs to support hls streaming.
srt-1-fit
srt-1.5.3.tar.gz
* https://github.com/Haivision/srt/releases/tag/v1.5.3
* https://ossrs.net/lts/zh-cn/license#srt
openssl-1.1-fit
openssl-1.1.1l.tar.gz
* http://www.openssl.org/source/openssl-1.1.1l.tar.gz
openssl-1.1.0e.zip
openssl-OpenSSL_1_0_2u.tar.gz
* http://www.openssl.org/source/openssl-1.1.0e.tar.gz
* openssl for SRS(with-ssl) RTMP complex handshake to delivery h264+aac stream.
* SRTP depends on openssl 1.0.*, so we use both ssl versions.
* https://ossrs.net/lts/zh-cn/license#openssl
libsrtp-2.3.0.tar.gz
* For WebRTC, SRTP to encrypt and decrypt RTP.
* https://github.com/cisco/libsrtp/releases/tag/v2.3.0
ffmpeg-4.2.tar.gz
opus-1.3.1.tar.gz
* http://ffmpeg.org/releases/ffmpeg-4.2.tar.gz
* https://github.com/xiph/opus/releases/tag/v1.3.1
* To support RTMP/WebRTC transcoding.
* https://ossrs.net/lts/zh-cn/license#ffmpeg
gtest-fit
* google test framework.
* https://github.com/google/googletest/releases/tag/release-1.11.0
gperftools-2-fit
* gperf tools for performance benchmark.
* https://github.com/gperftools/gperftools/releases/tag/gperftools-2.9.1
st-srs
st-1.9.zip
state-threads
state-threads-1.9.1.tar.gz
* Patched ST from https://github.com/ossrs/state-threads
* https://ossrs.net/lts/zh-cn/license#state-threads
JSON
* https://github.com/udp/json-parser
* https://ossrs.net/lts/zh-cn/license#json
USRSCTP
* https://ossrs.net/lts/zh-cn/license#usrsctp
links:
* state-threads:
https://github.com/ossrs/state-threads
* x264:
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20131129-2245-stable.tar.bz2
* lame:
http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
* yasm:
http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
* speex:
http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz

Binary file not shown.

View file

@ -1,17 +0,0 @@
#!/bin/bash
# check exists.
if [[ -f /usr/local/bin/ccache ]]; then
echo "ccache is ok";
exit 0;
fi
# check sudoer.
sudo echo "ok" > /dev/null 2>&1;
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "you must be sudoer"; exit 1; fi
unzip ccache-3.1.9.zip && cd ccache-3.1.9 && ./configure && make
ret=$?; if [[ $ret -ne 0 ]]; then echo "build ccache failed."; exit $ret; fi
sudo cp ccache /usr/local/bin && sudo ln -s ccache /usr/local/bin/gcc && sudo ln -s ccache /usr/local/bin/g++ && sudo ln -s ccache /usr/local/bin/cc && sudo ln -s ccache /usr/local/bin/c++
ret=$?; if [[ $ret -ne 0 ]]; then echo "install ccache failed."; exit $ret; fi

Binary file not shown.

View file

@ -1,11 +0,0 @@
ccache是samba组织提供的加速编译过程的工具
使用虚拟机编译可以考虑用这个工具,让编译过程飞快。
链接:
http://ccache.samba.org/
http://samba.org/ftp/ccache/ccache-3.1.9.tar.xz
http://ccache.samba.org/manual.html
安装方法:
bash build_ccache.sh
注意要求以sudoer执行要修改文件。

21
trunk/3rdparty/ffmpeg-4-fit/.gitignore vendored Normal file
View file

@ -0,0 +1,21 @@
# Ignore files.
*.d
*.pc
*.o
_release
# We should remove bellow files in depends.sh
doc
config.asm
config.h
ffbuild/config.fate
ffbuild/config.log
ffbuild/config.mak
ffbuild/config.sh
ffbuild/.config
libavutil/lib.version
libavutil/libavutil.version
libavutil/ffversion.h
libavutil/avconfig.h
libavcodec/libavcodec.version
libswresample/libswresample.version

0
trunk/3rdparty/ffmpeg-4-fit/.version vendored Normal file
View file

120
trunk/3rdparty/ffmpeg-4-fit/LICENSE.md vendored Normal file
View file

@ -0,0 +1,120 @@
# License
Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
FFmpeg.
Some optional parts of FFmpeg are licensed under the GNU General Public License
version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of
these parts are used by default, you have to explicitly pass `--enable-gpl` to
configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
Specifically, the GPL parts of FFmpeg are:
- libpostproc
- optional x86 optimization in the files
- `libavcodec/x86/flac_dsp_gpl.asm`
- `libavcodec/x86/idct_mmx.c`
- `libavfilter/x86/vf_removegrain.asm`
- the following building and testing tools
- `compat/solaris/make_sunver.pl`
- `doc/t2h.pm`
- `doc/texi2pod.pl`
- `libswresample/swresample-test.c`
- `tests/checkasm/*`
- `tests/tiny_ssim.c`
- the following filters in libavfilter:
- `vf_blackframe.c`
- `vf_boxblur.c`
- `vf_colormatrix.c`
- `vf_cover_rect.c`
- `vf_cropdetect.c`
- `vf_delogo.c`
- `vf_eq.c`
- `vf_find_rect.c`
- `vf_fspp.c`
- `vf_geq.c`
- `vf_histeq.c`
- `vf_hqdn3d.c`
- `vf_interlace.c`
- `vf_kerndeint.c`
- `vf_mcdeint.c`
- `vf_mpdecimate.c`
- `vf_owdenoise.c`
- `vf_perspective.c`
- `vf_phase.c`
- `vf_pp.c`
- `vf_pp7.c`
- `vf_pullup.c`
- `vf_repeatfields.c`
- `vf_sab.c`
- `vf_smartblur.c`
- `vf_spp.c`
- `vf_stereo3d.c`
- `vf_super2xsai.c`
- `vf_tinterlace.c`
- `vf_uspp.c`
- `vsrc_mptestsrc.c`
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
the configure parameter `--enable-version3` will activate this licensing option
for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts,
`COPYING.GPLv3` to learn the exact legal terms that apply in this case.
There are a handful of files under other licensing terms, namely:
* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and
`libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for
licensing details. Specifically note that you must credit the IJG in the
documentation accompanying your program if you only distribute executables.
You must also indicate any changes including additions and deletions to
those three files in the documentation.
* `tests/reference.pnm` is under the expat license.
## External libraries
FFmpeg can be combined with a number of external libraries, which sometimes
affect the licensing of binaries resulting from the combination.
### Compatible libraries
The following libraries are under GPL:
- frei0r
- libcdio
- librubberband
- libvidstab
- libx264
- libx265
- libxavs
- libxvid
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
passing `--enable-gpl` to configure.
The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
license is incompatible with the LGPL v2.1 and the GPL v2, but not with
version 3 of those licenses. So to combine these libraries with FFmpeg, the
license version needs to be upgraded by passing `--enable-version3` to configure.
### Incompatible libraries
There are certain libraries you can combine with FFmpeg whose licenses are not
compatible with the GPL and/or the LGPL. If you wish to enable these
libraries, even in circumstances that their license may be incompatible, pass
`--enable-nonfree` to configure. But note that if you enable any of these
libraries the resulting binary will be under a complex license mix that is
more restrictive than the LGPL and that may result in additional obligations.
It is possible that these restrictions cause the resulting binary to be
unredistributable.
The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are
incompatible with the GPLv2 and v3. To the best of our knowledge, they are
compatible with the LGPL.
The NVENC library, while its header file is licensed under the compatible MIT
license, requires a proprietary binary blob at run time, and is deemed to be
incompatible with the GPL. We are not certain if it is compatible with the
LGPL, but we require `--enable-nonfree` even with LGPL configurations in case
it is not.

167
trunk/3rdparty/ffmpeg-4-fit/Makefile vendored Normal file
View file

@ -0,0 +1,167 @@
MAIN_MAKEFILE=1
include ffbuild/config.mak
vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH)
vpath %.inc $(SRC_PATH)
vpath %.m $(SRC_PATH)
vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH)
vpath %.rc $(SRC_PATH)
vpath %.v $(SRC_PATH)
vpath %.texi $(SRC_PATH)
vpath %.cu $(SRC_PATH)
vpath %.ptx $(SRC_PATH)
vpath %/fate_config.sh.template $(SRC_PATH)
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
# $(FFLIBS-yes) needs to be in linking order
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_AVFORMAT) += avformat
FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
FFLIBS-$(CONFIG_POSTPROC) += postproc
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
FFLIBS-$(CONFIG_SWSCALE) += swscale
FFLIBS := avutil
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
SKIPHEADERS = compat/w32pthreads.h
# first so "all" becomes default target
all: all-yes
include $(SRC_PATH)/ffbuild/common.mak
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
$(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
CONFIGURABLE_COMPONENTS = \
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
$(SRC_PATH)/libavcodec/bitstream_filters.c \
$(SRC_PATH)/libavcodec/parsers.c \
$(SRC_PATH)/libavformat/protocols.c \
config.h: ffbuild/.config
ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
@-tput bold 2>/dev/null
@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null
SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
define RESET
$(1) :=
$(1)-yes :=
endef
define DOSUBDIR
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
SUBDIR := $(1)/
include $(SRC_PATH)/$(1)/Makefile
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
include $(SRC_PATH)/ffbuild/library.mak
endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
ifeq ($(STRIPTYPE),direct)
$(STRIP) -o $@ $<
else
$(CP) $< $@
$(STRIP) $@
endif
%$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
.version: M=@
libavutil/ffversion.h .version:
$(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
$(Q)touch .version
# force version.sh to run whenever version might have changed
-include .version
install: install-libs install-headers
install-libs: install-libs-yes
install-data: $(DATA_FILES)
$(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
uninstall: uninstall-data uninstall-headers uninstall-libs uninstall-pkgconfig
uninstall-data:
$(RM) -r "$(DATADIR)"
clean::
$(RM) $(CLEANSUFFIXES)
$(RM) $(addprefix compat/,$(CLEANSUFFIXES)) $(addprefix compat/*/,$(CLEANSUFFIXES))
$(RM) -r coverage-html
$(RM) -rf coverage.info coverage.info.in lcov
distclean:: clean
$(RM) .version avversion.h config.asm config.h mapfile \
ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
version.h libavutil/ffversion.h libavcodec/codec_names.h \
libavcodec/bsf_list.c libavformat/protocol_list.c \
libavcodec/codec_list.c libavcodec/parser_list.c \
libavformat/muxer_list.c libavformat/demuxer_list.c
ifeq ($(SRC_LINK),src)
$(RM) src
endif
$(RM) -rf doc/examples/pc-uninstalled
config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
build: all alltools examples testprogs
check: all alltools examples testprogs fate
$(sort $(OBJDIRS)):
$(Q)mkdir -p $@
# Dummy rule to stop make trying to rebuild removed or renamed headers
%.h:
@:
# Disable suffix rules. Most of the builtin rules are suffix rules,
# so this saves some time on slow systems.
.SUFFIXES:
.PHONY: all all-yes alltools build check config testprogs
.PHONY: *clean install* uninstall*

View file

@ -0,0 +1,173 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/
#ifndef COMPAT_ATOMICS_GCC_STDATOMIC_H
#define COMPAT_ATOMICS_GCC_STDATOMIC_H
#include <stddef.h>
#include <stdint.h>
#define ATOMIC_FLAG_INIT 0
#define ATOMIC_VAR_INIT(value) (value)
#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)
#define kill_dependency(y) ((void)0)
#define atomic_thread_fence(order) \
__sync_synchronize()
#define atomic_signal_fence(order) \
((void)0)
#define atomic_is_lock_free(obj) 0
typedef _Bool atomic_flag;
typedef _Bool atomic_bool;
typedef char atomic_char;
typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
typedef unsigned long atomic_ulong;
typedef long long atomic_llong;
typedef unsigned long long atomic_ullong;
typedef wchar_t atomic_wchar_t;
typedef int_least8_t atomic_int_least8_t;
typedef uint_least8_t atomic_uint_least8_t;
typedef int_least16_t atomic_int_least16_t;
typedef uint_least16_t atomic_uint_least16_t;
typedef int_least32_t atomic_int_least32_t;
typedef uint_least32_t atomic_uint_least32_t;
typedef int_least64_t atomic_int_least64_t;
typedef uint_least64_t atomic_uint_least64_t;
typedef int_fast8_t atomic_int_fast8_t;
typedef uint_fast8_t atomic_uint_fast8_t;
typedef int_fast16_t atomic_int_fast16_t;
typedef uint_fast16_t atomic_uint_fast16_t;
typedef int_fast32_t atomic_int_fast32_t;
typedef uint_fast32_t atomic_uint_fast32_t;
typedef int_fast64_t atomic_int_fast64_t;
typedef uint_fast64_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef uintptr_t atomic_uintptr_t;
typedef size_t atomic_size_t;
typedef ptrdiff_t atomic_ptrdiff_t;
typedef intmax_t atomic_intmax_t;
typedef uintmax_t atomic_uintmax_t;
#define atomic_store(object, desired) \
do { \
*(object) = (desired); \
__sync_synchronize(); \
} while (0)
#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)
#define atomic_load(object) \
(__sync_synchronize(), *(object))
#define atomic_load_explicit(object, order) \
atomic_load(object)
#define atomic_exchange(object, desired) \
({ \
__typeof__(object) _obj = (object); \
__typeof__(*object) _old; \
do \
_old = atomic_load(_obj); \
while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \
_old; \
})
#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)
#define atomic_compare_exchange_strong(object, expected, desired) \
({ \
__typeof__(object) _exp = (expected); \
__typeof__(*object) _old = *_exp; \
*_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
*_exp == _old; \
})
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)
#define atomic_fetch_add(object, operand) \
__sync_fetch_and_add(object, operand)
#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)
#define atomic_fetch_sub(object, operand) \
__sync_fetch_and_sub(object, operand)
#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)
#define atomic_fetch_or(object, operand) \
__sync_fetch_and_or(object, operand)
#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)
#define atomic_fetch_xor(object, operand) \
__sync_fetch_and_xor(object, operand)
#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)
#define atomic_fetch_and(object, operand) \
__sync_fetch_and_and(object, operand)
#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)
#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)
#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)
#define atomic_flag_clear(object) \
atomic_store(object, 0)
#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)
#endif /* COMPAT_ATOMICS_GCC_STDATOMIC_H */

View file

@ -0,0 +1,34 @@
/*
* MSVC Compatible va_copy macro
* Copyright (c) 2012 Derek Buitenhuis
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_VA_COPY_H
#define COMPAT_VA_COPY_H
#include <stdarg.h>
#if !defined(va_copy) && defined(_MSC_VER)
#define va_copy(dst, src) ((dst) = (src))
#endif
#if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3
#define va_copy(dst, src) __va_copy(dst, src)
#endif
#endif /* COMPAT_VA_COPY_H */

7383
trunk/3rdparty/ffmpeg-4-fit/configure vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes)
OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes)
OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)
OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
OBJS-$(HAVE_MSA) += $(MSA-OBJS) $(MSA-OBJS-yes)
OBJS-$(HAVE_MMI) += $(MMI-OBJS) $(MMI-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)

View file

@ -0,0 +1,176 @@
#
# common bits used by all libraries
#
DEFAULT_X86ASMD=.dbg
ifeq ($(DBG),1)
X86ASMD=$(DEFAULT_X86ASMD)
else
X86ASMD=
endif
ifndef SUBDIR
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC
SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
MSG = $@
M = @$(call ECHO,$(TAG),$@);
$(foreach VAR,$(BRIEF), \
$(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
endif
ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
# NASM requires -I path terminated with /
IFLAGS := -I. -I$(SRC_LINK)/
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
CFLAGS += $(ECFLAGS)
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
OBJCFLAGS += $(EOBJCFLAGS)
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
CXXFLAGS := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
NVCCFLAGS += -ptx
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
define COMPILE
$(call $(1)DEP,$(1))
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
endef
COMPILE_C = $(call COMPILE,CC)
COMPILE_CXX = $(call COMPILE,CXX)
COMPILE_S = $(call COMPILE,AS)
COMPILE_M = $(call COMPILE,OBJCC)
COMPILE_X86ASM = $(call COMPILE,X86ASM)
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
COMPILE_NVCC = $(call COMPILE,NVCC)
%.o: %.c
$(COMPILE_C)
%.o: %.cpp
$(COMPILE_CXX)
%.o: %.m
$(COMPILE_M)
%.s: %.c
$(CC) $(CCFLAGS) -S -o $@ $<
%.o: %.S
$(COMPILE_S)
%_host.o: %.c
$(COMPILE_HOSTC)
%$(DEFAULT_X86ASMD).asm: %.asm
$(DEPX86ASM) $(X86ASMFLAGS) -M -o $@ $< > $(@:.asm=.d)
$(X86ASM) $(X86ASMFLAGS) -e $< | sed '/^%/d;/^$$/d;' > $@
%.o: %.asm
$(COMPILE_X86ASM)
-$(if $(ASMSTRIPFLAGS), $(STRIP) $(ASMSTRIPFLAGS) $@)
%.o: %.rc
$(WINDRES) $(IFLAGS) --preprocessor "$(DEPWINDRES) -E -xc-header -DRC_INVOKED $(CC_DEPFLAGS)" -o $@ $<
%.i: %.c
$(CC) $(CCFLAGS) $(CC_E) $<
%.h.c:
$(Q)echo '#include "$*.h"' >$@
%.ptx: %.cu
$(COMPILE_NVCC)
%.ptx.c: %.ptx
$(Q)sh $(SRC_PATH)/compat/cuda/ptx2c.sh $@ $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
%.c %.h %.pc %.ver %.version: TAG = GEN
# Dummy rule to stop make trying to rebuild removed or renamed headers
%.h:
@:
# Disable suffix rules. Most of the builtin rules are suffix rules,
# so this saves some time on slow systems.
.SUFFIXES:
# Do not delete intermediate files from chains of implicit rules
$(OBJS):
endif
include $(SRC_PATH)/ffbuild/arch.mak
OBJS += $(OBJS-yes)
SLIBOBJS += $(SLIBOBJS-yes)
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(foreach lib,EXTRALIBS-$(NAME) $(FFLIBS:%=EXTRALIBS-%),$($(lib))) $(EXTRALIBS)
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
TOOLS += $(TOOLS-yes)
TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
HEADERS += $(HEADERS-yes)
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
SRC_DIR := $(SRC_PATH)/lib$(NAME)
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
HOBJS = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
PTXOBJS = $(filter %.ptx.o,$(OBJS))
$(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
checkheaders: $(HOBJS)
.SECONDARY: $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=)
alltools: $(TOOLS)
$(HOSTOBJS): %.o: %.c
$(COMPILE_HOSTC)
$(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
$(OBJS): | $(sort $(dir $(OBJS)))
$(HOBJS): | $(sort $(dir $(HOBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
$(SLIBOBJS): | $(sort $(dir $(SLIBOBJS)))
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
$(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES
clean::
$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
endef
$(eval $(RULES))
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d)

View file

@ -0,0 +1,107 @@
include $(SRC_PATH)/ffbuild/common.mak
ifeq (,$(filter %clean config,$(MAKECMDGOALS)))
-include $(SUBDIR)lib$(NAME).version
endif
LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
LIBMINOR := $(lib$(NAME)_VERSION_MINOR)
INCINSTDIR := $(INCDIR)/lib$(NAME)
INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) $(SUBDIR)lib$(FULLNAME).pc
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) $(SUBDIR)lib$(FULLNAME).pc
LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
$(SUBDIR)$(LIBNAME): $(OBJS)
$(RM) $@
$(AR) $(ARFLAGS) $(AR_O) $^
$(RANLIB) $@
install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
define RULES
$(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
$(LIBOBJS): CPPFLAGS += -DBUILDING_$(NAME)
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(EXTRALIBS-$$(*F)) $$(ELIBS)
$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h | $(SUBDIR)
$$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$< > $$@
$(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)version.h ffbuild/config.sh | $(SUBDIR)
$$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"
$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
$$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
$(SLIB_EXTRA_CMD)
ifdef SUBDIR
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
endif
clean::
$(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
$(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
$(Q)mkdir -p "$(SHLIBDIR)"
$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
$$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
$(Q)$(foreach F,$(SLIB_INSTALL_LINKS),(cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F));)
$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
$(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
$(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
$(Q)mkdir -p "$(LIBDIR)"
$$(INSTALL) -m 644 $$< "$(LIBDIR)"
$(LIB_INSTALL_EXTRA_CMD)
install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
$(Q)mkdir -p "$(INCINSTDIR)"
$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
$(Q)mkdir -p "$(PKGCONFIGDIR)"
$$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"
uninstall-libs::
-$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
"$(SHLIBDIR)/$(SLIBNAME)" \
"$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
-$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
-$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
-$(RM) "$(LIBDIR)/$(LIBNAME)"
uninstall-headers::
$(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
-rmdir "$(INCINSTDIR)"
uninstall-pkgconfig::
$(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
endef
$(eval $(RULES))
$(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
testprogs: $(TESTPROGS)

View file

@ -0,0 +1,13 @@
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
name=lib$1
ucname=$(toupper ${name})
file=$2
eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO
eval echo "${name}_VERSION=\$${ucname}_VERSION"
eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR"
eval echo "${name}_VERSION_MINOR=\$${ucname}_VERSION_MINOR"

View file

@ -0,0 +1,62 @@
#!/bin/sh
. ffbuild/config.sh
if test "$shared" = "yes"; then
shared=true
else
shared=false
fi
shortname=$1
name=lib${shortname}
fullname=${name}${build_suffix}
comment=$2
libs=$(eval echo \$extralibs_${shortname})
deps=$(eval echo \$${shortname}_deps)
for dep in $deps; do
depname=lib${dep}
fulldepname=${depname}${build_suffix}
. ${depname}/${depname}.version
depversion=$(eval echo \$${depname}_VERSION)
requires="$requires ${fulldepname} >= ${depversion}, "
done
requires=${requires%, }
version=$(grep ${name}_VERSION= $name/${name}.version | cut -d= -f2)
cat <<EOF > $name/$fullname.pc
prefix=$prefix
exec_prefix=\${prefix}
libdir=$libdir
includedir=$incdir
Name: $fullname
Description: $comment
Version: $version
Requires: $($shared || echo $requires)
Requires.private: $($shared && echo $requires)
Conflicts:
Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
Libs.private: $($shared && echo $libs)
Cflags: -I\${includedir}
EOF
mkdir -p doc/examples/pc-uninstalled
includedir=${source_path}
[ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
cat <<EOF > doc/examples/pc-uninstalled/${name}-uninstalled.pc
prefix=
exec_prefix=
libdir=\${pcfiledir}/../../../$name
includedir=${source_path}
Name: $fullname
Description: $comment
Version: $version
Requires: $requires
Conflicts:
Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${fullname#lib} $($shared || echo $libs)
Cflags: -I\${includedir}
EOF

View file

@ -0,0 +1,63 @@
#!/bin/sh
# Usage: version.sh <ffmpeg-root-dir> <output-version.h> <extra-version>
# check for git short hash
if ! test "$revision"; then
if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
else
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
fi
fi
# Shallow Git clones (--depth) do not have the N tag:
# use 'git-YYYY-MM-DD-hhhhhhh'.
test "$revision" || revision=$(cd "$1" &&
git log -1 --pretty=format:"git-%cd-%h" --date=short 2> /dev/null)
# Snapshots from gitweb are in a directory called ffmpeg-hhhhhhh or
# ffmpeg-HEAD-hhhhhhh.
if [ -z "$revision" ]; then
srcdir=$(cd "$1" && pwd)
case "$srcdir" in
*/ffmpeg-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])
git_hash="${srcdir##*-}";;
*/ffmpeg-HEAD-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])
git_hash="${srcdir##*-}";;
esac
fi
# no revision number found
test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
# Append the Git hash if we have one
test "$revision" && test "$git_hash" && revision="$revision-$git_hash"
# releases extract the version number from the VERSION file
version=$(cd "$1" && cat VERSION 2> /dev/null)
test "$version" || version=$revision
test -n "$3" && version=$version-$3
if [ -z "$2" ]; then
echo "$version"
exit
fi
NEW_REVISION="#define FFMPEG_VERSION \"$version\""
OLD_REVISION=$(cat "$2" 2> /dev/null | head -4 | tail -1)
# String used for preprocessor guard
GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//')
# Update version header only on revision changes to avoid spurious rebuilds
if test "$NEW_REVISION" != "$OLD_REVISION"; then
cat << EOF > "$2"
/* Automatically generated by version.sh, do not manually edit! */
#ifndef $GUARD
#define $GUARD
$NEW_REVISION
#endif /* $GUARD */
EOF
fi

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,377 @@
/*
* AAC definitions and structures
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC definitions and structures
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#ifndef AVCODEC_AAC_H
#define AVCODEC_AAC_H
#include "aac_defines.h"
#include "libavutil/float_dsp.h"
#include "libavutil/fixed_dsp.h"
#include "avcodec.h"
#if !USE_FIXED
#include "mdct15.h"
#endif
#include "fft.h"
#include "mpeg4audio.h"
#include "sbr.h"
#include <stdint.h>
#define MAX_CHANNELS 64
#define MAX_ELEM_ID 16
#define TNS_MAX_ORDER 20
#define MAX_LTP_LONG_SFB 40
#define CLIP_AVOIDANCE_FACTOR 0.95f
enum RawDataBlockType {
TYPE_SCE,
TYPE_CPE,
TYPE_CCE,
TYPE_LFE,
TYPE_DSE,
TYPE_PCE,
TYPE_FIL,
TYPE_END,
};
enum ExtensionPayloadID {
EXT_FILL,
EXT_FILL_DATA,
EXT_DATA_ELEMENT,
EXT_DYNAMIC_RANGE = 0xb,
EXT_SBR_DATA = 0xd,
EXT_SBR_DATA_CRC = 0xe,
};
enum WindowSequence {
ONLY_LONG_SEQUENCE,
LONG_START_SEQUENCE,
EIGHT_SHORT_SEQUENCE,
LONG_STOP_SEQUENCE,
};
enum BandType {
ZERO_BT = 0, ///< Scalefactors and spectral data are all zero.
FIRST_PAIR_BT = 5, ///< This and later band types encode two values (rather than four) with one code word.
ESC_BT = 11, ///< Spectral data are coded with an escape sequence.
RESERVED_BT = 12, ///< Band types following are encoded differently from others.
NOISE_BT = 13, ///< Spectral data are scaled white noise not coded in the bitstream.
INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions (out of phase).
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions (in phase).
};
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
enum ChannelPosition {
AAC_CHANNEL_OFF = 0,
AAC_CHANNEL_FRONT = 1,
AAC_CHANNEL_SIDE = 2,
AAC_CHANNEL_BACK = 3,
AAC_CHANNEL_LFE = 4,
AAC_CHANNEL_CC = 5,
};
/**
* The point during decoding at which channel coupling is applied.
*/
enum CouplingPoint {
BEFORE_TNS,
BETWEEN_TNS_AND_IMDCT,
AFTER_IMDCT = 3,
};
/**
* Output configuration status
*/
enum OCStatus {
OC_NONE, ///< Output unconfigured
OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE
OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header
OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked
OC_LOCKED, ///< Output configuration locked in place
};
typedef struct OutputConfiguration {
MPEG4AudioConfig m4ac;
uint8_t layout_map[MAX_ELEM_ID*4][3];
int layout_map_tags;
int channels;
uint64_t channel_layout;
enum OCStatus status;
} OutputConfiguration;
/**
* Predictor State
*/
typedef struct PredictorState {
AAC_FLOAT cor0;
AAC_FLOAT cor1;
AAC_FLOAT var0;
AAC_FLOAT var1;
AAC_FLOAT r0;
AAC_FLOAT r1;
AAC_FLOAT k1;
AAC_FLOAT x_est;
} PredictorState;
#define MAX_PREDICTORS 672
#define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times
#define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0
#define SCALE_MAX_POS 255 ///< scalefactor index maximum value
#define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard
#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference
#define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
#define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band
#define NOISE_PRE_BITS 9 ///< length of preamble
#define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble
/**
* Long Term Prediction
*/
typedef struct LongTermPrediction {
int8_t present;
int16_t lag;
int coef_idx;
INTFLOAT coef;
int8_t used[MAX_LTP_LONG_SFB];
} LongTermPrediction;
/**
* Individual Channel Stream
*/
typedef struct IndividualChannelStream {
uint8_t max_sfb; ///< number of scalefactor bands per group
enum WindowSequence window_sequence[2];
uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sine window.
int num_window_groups;
uint8_t group_len[8];
LongTermPrediction ltp;
const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window
const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window
int num_swb; ///< number of scalefactor window bands
int num_windows;
int tns_max_bands;
int predictor_present;
int predictor_initialized;
int predictor_reset_group;
int predictor_reset_count[31]; ///< used by encoder to count prediction resets
uint8_t prediction_used[41];
uint8_t window_clipping[8]; ///< set if a certain window is near clipping
float clip_avoidance_factor; ///< set if any window is near clipping to the necessary atennuation factor to avoid it
} IndividualChannelStream;
/**
* Temporal Noise Shaping
*/
typedef struct TemporalNoiseShaping {
int present;
int n_filt[8];
int length[8][4];
int direction[8][4];
int order[8][4];
int coef_idx[8][4][TNS_MAX_ORDER];
INTFLOAT coef[8][4][TNS_MAX_ORDER];
} TemporalNoiseShaping;
/**
* Dynamic Range Control - decoded from the bitstream but not processed further.
*/
typedef struct DynamicRangeControl {
int pce_instance_tag; ///< Indicates with which program the DRC info is associated.
int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative
int dyn_rng_ctl[17]; ///< DRC magnitude information
int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing.
int band_incr; ///< Number of DRC bands greater than 1 having DRC info.
int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain.
int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines.
int prog_ref_level; /**< A reference level for the long-term program audio level for all
* channels combined.
*/
} DynamicRangeControl;
typedef struct Pulse {
int num_pulse;
int start;
int pos[4];
int amp[4];
} Pulse;
/**
* coupling parameters
*/
typedef struct ChannelCoupling {
enum CouplingPoint coupling_point; ///< The point during decoding at which coupling is applied.
int num_coupled; ///< number of target elements
enum RawDataBlockType type[8]; ///< Type of channel element to be coupled - SCE or CPE.
int id_select[8]; ///< element id
int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel;
* [2] list of gains for left channel; [3] lists of gains for both channels
*/
INTFLOAT gain[16][120];
} ChannelCoupling;
/**
* Single Channel Element - used for both SCE and LFE elements.
*/
typedef struct SingleChannelElement {
IndividualChannelStream ics;
TemporalNoiseShaping tns;
Pulse pulse;
enum BandType band_type[128]; ///< band types
enum BandType band_alt[128]; ///< alternative band type (used by encoder)
int band_type_run_end[120]; ///< band type run end points
INTFLOAT sf[120]; ///< scalefactors
int sf_idx[128]; ///< scalefactor indices (used by encoder)
uint8_t zeroes[128]; ///< band is not coded (used by encoder)
uint8_t can_pns[128]; ///< band is allowed to PNS (informative)
float is_ener[128]; ///< Intensity stereo pos (used by encoder)
float pns_ener[128]; ///< Noise energy values (used by encoder)
DECLARE_ALIGNED(32, INTFLOAT, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine
DECLARE_ALIGNED(32, INTFLOAT, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed
DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
DECLARE_ALIGNED(32, AAC_FLOAT, lcoeffs)[1024]; ///< MDCT of LTP coefficients (used by encoder)
DECLARE_ALIGNED(32, AAC_FLOAT, prcoeffs)[1024]; ///< Main prediction coefs (used by encoder)
PredictorState predictor_state[MAX_PREDICTORS];
INTFLOAT *ret; ///< PCM output
} SingleChannelElement;
/**
* channel element - generic struct for SCE/CPE/CCE/LFE
*/
typedef struct ChannelElement {
int present;
// CPE specific
int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)
uint8_t is_mode; ///< Set if any bands have been encoded using intensity stereo (used by encoder)
uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band
uint8_t is_mask[128]; ///< Set if intensity stereo is used (used by encoder)
// shared
SingleChannelElement ch[2];
// CCE specific
ChannelCoupling coup;
SpectralBandReplication sbr;
} ChannelElement;
/**
* main AAC context
*/
struct AACContext {
AVClass *class;
AVCodecContext *avctx;
AVFrame *frame;
int is_saved; ///< Set if elements have stored overlap from previous frame.
DynamicRangeControl che_drc;
/**
* @name Channel element related data
* @{
*/
ChannelElement *che[4][MAX_ELEM_ID];
ChannelElement *tag_che_map[4][MAX_ELEM_ID];
int tags_mapped;
int warned_remapping_once;
/** @} */
/**
* @name temporary aligned temporary buffers
* (We do not want to have these on the stack.)
* @{
*/
DECLARE_ALIGNED(32, INTFLOAT, buf_mdct)[1024];
/** @} */
/**
* @name Computed / set up during initialization
* @{
*/
FFTContext mdct;
FFTContext mdct_small;
FFTContext mdct_ld;
FFTContext mdct_ltp;
#if USE_FIXED
AVFixedDSPContext *fdsp;
#else
MDCT15Context *mdct120;
MDCT15Context *mdct480;
MDCT15Context *mdct960;
AVFloatDSPContext *fdsp;
#endif /* USE_FIXED */
int random_state;
/** @} */
/**
* @name Members used for output
* @{
*/
SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement
/** @} */
/**
* @name Japanese DTV specific extension
* @{
*/
int force_dmono_mode;///< 0->not dmono, 1->use first channel, 2->use second channel
int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel
/** @} */
DECLARE_ALIGNED(32, INTFLOAT, temp)[128];
OutputConfiguration oc[2];
int warned_num_aac_frames;
int warned_960_sbr;
int warned_gain_control;
/* aacdec functions pointers */
void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce);
void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce);
void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns,
IndividualChannelStream *ics, int decode);
void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out,
INTFLOAT *in, IndividualChannelStream *ics);
void (*update_ltp)(AACContext *ac, SingleChannelElement *sce);
void (*vector_pow43)(int *coefs, int len);
void (*subband_scale)(int *dst, int *src, int scale, int offset, int len);
};
void ff_aacdec_init_mips(AACContext *c);
#endif /* AVCODEC_AAC_H */

View file

@ -0,0 +1,105 @@
/*
* Common AAC and AC-3 parser
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "parser.h"
#include "aac_ac3_parser.h"
int ff_aac_ac3_parse(AVCodecParserContext *s1,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
AACAC3ParseContext *s = s1->priv_data;
ParseContext *pc = &s->pc;
int len, i;
int new_frame_start;
int got_frame = 0;
get_next:
i=END_NOT_FOUND;
if(s->remaining_size <= buf_size){
if(s->remaining_size && !s->need_next_header){
i= s->remaining_size;
s->remaining_size = 0;
}else{ //we need a header first
len=0;
for(i=s->remaining_size; i<buf_size; i++){
s->state = (s->state<<8) + buf[i];
if((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start)))
break;
}
if(len<=0){
i=END_NOT_FOUND;
}else{
got_frame = 1;
s->state=0;
i-= s->header_size -1;
s->remaining_size = len;
if(!new_frame_start || pc->index+i<=0){
s->remaining_size += i;
goto get_next;
}
else if (i < 0) {
s->remaining_size += i;
}
}
}
}
if(ff_combine_frame(pc, i, &buf, &buf_size)<0){
s->remaining_size -= FFMIN(s->remaining_size, buf_size);
*poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
*poutbuf = buf;
*poutbuf_size = buf_size;
/* update codec info */
if(s->codec_id)
avctx->codec_id = s->codec_id;
if (got_frame) {
/* Due to backwards compatible HE-AAC the sample rate, channel count,
and total number of samples found in an AAC ADTS header are not
reliable. Bit rate is still accurate because the total frame
duration in seconds is still correct (as is the number of bits in
the frame). */
if (avctx->codec_id != AV_CODEC_ID_AAC) {
avctx->sample_rate = s->sample_rate;
if (avctx->codec_id != AV_CODEC_ID_EAC3) {
avctx->channels = s->channels;
avctx->channel_layout = s->channel_layout;
}
s1->duration = s->samples;
avctx->audio_service_type = s->service_type;
}
if (avctx->codec_id != AV_CODEC_ID_EAC3)
avctx->bit_rate = s->bit_rate;
}
return i;
}

View file

@ -0,0 +1,66 @@
/*
* Common AAC and AC-3 parser prototypes
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_AC3_PARSER_H
#define AVCODEC_AAC_AC3_PARSER_H
#include <stdint.h>
#include "avcodec.h"
#include "parser.h"
typedef enum {
AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a,
AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a,
AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,
AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,
AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,
AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a,
AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,
} AACAC3ParseError;
typedef struct AACAC3ParseContext {
ParseContext pc;
int frame_size;
int header_size;
int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info,
int *need_next_header, int *new_frame_start);
int channels;
int sample_rate;
int bit_rate;
int samples;
uint64_t channel_layout;
int service_type;
int remaining_size;
uint64_t state;
int need_next_header;
enum AVCodecID codec_id;
} AACAC3ParseContext;
int ff_aac_ac3_parse(AVCodecParserContext *s1,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
#endif /* AVCODEC_AAC_AC3_PARSER_H */

View file

@ -0,0 +1,158 @@
/*
* MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream filter
* Copyright (c) 2009 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "adts_header.h"
#include "adts_parser.h"
#include "avcodec.h"
#include "bsf.h"
#include "put_bits.h"
#include "get_bits.h"
#include "mpeg4audio.h"
#include "internal.h"
typedef struct AACBSFContext {
int first_frame_done;
} AACBSFContext;
/**
* This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
* ADTS header and removes the ADTS header.
*/
static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *pkt)
{
AACBSFContext *ctx = bsfc->priv_data;
GetBitContext gb;
PutBitContext pb;
AACADTSHeaderInfo hdr;
int ret;
ret = ff_bsf_get_packet_ref(bsfc, pkt);
if (ret < 0)
return ret;
if (bsfc->par_in->extradata && pkt->size >= 2 && (AV_RB16(pkt->data) >> 4) != 0xfff)
return 0;
if (pkt->size < AV_AAC_ADTS_HEADER_SIZE)
goto packet_too_small;
init_get_bits(&gb, pkt->data, AV_AAC_ADTS_HEADER_SIZE * 8);
if (ff_adts_header_parse(&gb, &hdr) < 0) {
av_log(bsfc, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
ret = AVERROR_INVALIDDATA;
goto fail;
}
if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
avpriv_report_missing_feature(bsfc,
"Multiple RDBs per frame with CRC");
ret = AVERROR_PATCHWELCOME;
goto fail;
}
pkt->size -= AV_AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent;
if (pkt->size <= 0)
goto packet_too_small;
pkt->data += AV_AAC_ADTS_HEADER_SIZE + 2 * !hdr.crc_absent;
if (!ctx->first_frame_done) {
int pce_size = 0;
uint8_t pce_data[MAX_PCE_SIZE];
uint8_t *extradata;
if (!hdr.chan_config) {
init_get_bits(&gb, pkt->data, pkt->size * 8);
if (get_bits(&gb, 3) != 5) {
avpriv_report_missing_feature(bsfc,
"PCE-based channel configuration "
"without PCE as first syntax "
"element");
ret = AVERROR_PATCHWELCOME;
goto fail;
}
init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
pce_size = ff_copy_pce_data(&pb, &gb) / 8;
flush_put_bits(&pb);
pkt->size -= get_bits_count(&gb)/8;
pkt->data += get_bits_count(&gb)/8;
}
extradata = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
2 + pce_size);
if (!extradata) {
ret = AVERROR(ENOMEM);
goto fail;
}
init_put_bits(&pb, extradata, 2 + pce_size);
put_bits(&pb, 5, hdr.object_type);
put_bits(&pb, 4, hdr.sampling_index);
put_bits(&pb, 4, hdr.chan_config);
put_bits(&pb, 1, 0); //frame length - 1024 samples
put_bits(&pb, 1, 0); //does not depend on core coder
put_bits(&pb, 1, 0); //is not extension
flush_put_bits(&pb);
if (pce_size) {
memcpy(extradata + 2, pce_data, pce_size);
}
ctx->first_frame_done = 1;
}
return 0;
packet_too_small:
av_log(bsfc, AV_LOG_ERROR, "Input packet too small\n");
ret = AVERROR_INVALIDDATA;
fail:
av_packet_unref(pkt);
return ret;
}
static int aac_adtstoasc_init(AVBSFContext *ctx)
{
/* Validate the extradata if the stream is already MPEG-4 AudioSpecificConfig */
if (ctx->par_in->extradata) {
MPEG4AudioConfig mp4ac;
int ret = avpriv_mpeg4audio_get_config(&mp4ac, ctx->par_in->extradata,
ctx->par_in->extradata_size * 8, 1);
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Error parsing AudioSpecificConfig extradata!\n");
return ret;
}
}
return 0;
}
static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_AAC, AV_CODEC_ID_NONE,
};
const AVBitStreamFilter ff_aac_adtstoasc_bsf = {
.name = "aac_adtstoasc",
.priv_data_size = sizeof(AACBSFContext),
.init = aac_adtstoasc_init,
.filter = aac_adtstoasc_filter,
.codec_ids = codec_ids,
};

View file

@ -0,0 +1,116 @@
/*
* AAC defines
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AAC_DEFINES_H
#define AVCODEC_AAC_DEFINES_H
#ifndef USE_FIXED
#define USE_FIXED 0
#endif
#if USE_FIXED
#include "libavutil/softfloat.h"
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#define AAC_RENAME(x) x ## _fixed
#define AAC_RENAME_32(x) x ## _fixed_32
typedef int INTFLOAT;
typedef unsigned UINTFLOAT; ///< Equivalent to INTFLOAT, Used as temporal cast to avoid undefined sign overflow operations.
typedef int64_t INT64FLOAT;
typedef int16_t SHORTFLOAT;
typedef SoftFloat AAC_FLOAT;
typedef int AAC_SIGNE;
#define FIXR(a) ((int)((a) * 1 + 0.5))
#define FIXR10(a) ((int)((a) * 1024.0 + 0.5))
#define Q23(a) (int)((a) * 8388608.0 + 0.5)
#define Q30(x) (int)((x)*1073741824.0 + 0.5)
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
#define RANGE15(x) x
#define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024
#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)
#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)
#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)
#define AAC_MUL31(x, y) (int)(((int64_t)(x) * (y) + 0x40000000) >> 31)
#define AAC_MADD28(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
((int64_t)(a) * (b)) + \
0x8000000) >> 28)
#define AAC_MADD30(x, y, a, b) (int)((((int64_t)(x) * (y)) + \
((int64_t)(a) * (b)) + \
0x20000000) >> 30)
#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
((int64_t)(a) * (b)) + \
((int64_t)(c) * (d)) + \
((int64_t)(e) * (f)) + \
0x20000000) >> 30)
#define AAC_MSUB30(x, y, a, b) (int)((((int64_t)(x) * (y)) - \
((int64_t)(a) * (b)) + \
0x20000000) >> 30)
#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \
((int64_t)(a) * (b)) - \
((int64_t)(c) * (d)) - \
((int64_t)(e) * (f)) + \
0x20000000) >> 30)
#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \
((int64_t)(y) * (z)) + \
0x40000000) >> 31)
#define AAC_HALF_SUM(x, y) (((x) >> 1) + ((y) >> 1))
#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
#else
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#define AAC_RENAME(x) x
#define AAC_RENAME_32(x) x
typedef float INTFLOAT;
typedef float UINTFLOAT;
typedef float INT64FLOAT;
typedef float SHORTFLOAT;
typedef float AAC_FLOAT;
typedef unsigned AAC_SIGNE;
#define FIXR(x) ((float)(x))
#define FIXR10(x) ((float)(x))
#define Q23(x) ((float)(x))
#define Q30(x) ((float)(x))
#define Q31(x) ((float)(x))
#define RANGE15(x) (32768.0 * (x))
#define GET_GAIN(x, y) powf((x), -(y))
#define AAC_MUL16(x, y) ((x) * (y))
#define AAC_MUL26(x, y) ((x) * (y))
#define AAC_MUL30(x, y) ((x) * (y))
#define AAC_MUL31(x, y) ((x) * (y))
#define AAC_MADD28(x, y, a, b) ((x) * (y) + (a) * (b))
#define AAC_MADD30(x, y, a, b) ((x) * (y) + (a) * (b))
#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) + \
(c) * (d) + (e) * (f))
#define AAC_MSUB30(x, y, a, b) ((x) * (y) - (a) * (b))
#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) - \
(c) * (d) - (e) * (f))
#define AAC_MSUB31_V3(x, y, z) ((x) - (y)) * (z)
#define AAC_HALF_SUM(x, y) ((x) + (y)) * 0.5f
#define AAC_SRA_R(x, y) (x)
#endif /* USE_FIXED */
#endif /* AVCODEC_AAC_DEFINES_H */

View file

@ -0,0 +1,71 @@
/*
* Audio and Video frame extraction
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "parser.h"
#include "aac_ac3_parser.h"
#include "adts_header.h"
#include "adts_parser.h"
#include "get_bits.h"
#include "mpeg4audio.h"
static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int *need_next_header, int *new_frame_start)
{
GetBitContext bits;
AACADTSHeaderInfo hdr;
int size;
union {
uint64_t u64;
uint8_t u8[8 + AV_INPUT_BUFFER_PADDING_SIZE];
} tmp;
tmp.u64 = av_be2ne64(state);
init_get_bits(&bits, tmp.u8 + 8 - AV_AAC_ADTS_HEADER_SIZE,
AV_AAC_ADTS_HEADER_SIZE * 8);
if ((size = ff_adts_header_parse(&bits, &hdr)) < 0)
return 0;
*need_next_header = 0;
*new_frame_start = 1;
hdr_info->sample_rate = hdr.sample_rate;
hdr_info->channels = ff_mpeg4audio_channels[hdr.chan_config];
hdr_info->samples = hdr.samples;
hdr_info->bit_rate = hdr.bit_rate;
return size;
}
static av_cold int aac_parse_init(AVCodecParserContext *s1)
{
AACAC3ParseContext *s = s1->priv_data;
s->header_size = AV_AAC_ADTS_HEADER_SIZE;
s->sync = aac_sync;
return 0;
}
AVCodecParser ff_aac_parser = {
.codec_ids = { AV_CODEC_ID_AAC },
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = aac_parse_init,
.parser_parse = ff_aac_ac3_parse,
.parser_close = ff_parse_close,
};

View file

@ -0,0 +1,964 @@
/*
* AAC coefficients encoder
* Copyright (C) 2008-2009 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC coefficients encoder
*/
/***********************************
* TODOs:
* speedup quantizer selection
* add sane pulse detection
***********************************/
#include "libavutil/libm.h" // brought forward to work around cygwin header breakage
#include <float.h>
#include "libavutil/mathematics.h"
#include "mathops.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
#include "aacenctab.h"
#include "aacenc_utils.h"
#include "aacenc_quantization.h"
#include "aacenc_is.h"
#include "aacenc_tns.h"
#include "aacenc_ltp.h"
#include "aacenc_pred.h"
#include "libavcodec/aaccoder_twoloop.h"
/* Parameter of f(x) = a*(lambda/100), defines the maximum fourier spread
* beyond which no PNS is used (since the SFBs contain tone rather than noise) */
#define NOISE_SPREAD_THRESHOLD 0.9f
/* Parameter of f(x) = a*(100/lambda), defines how much PNS is allowed to
* replace low energy non zero bands */
#define NOISE_LAMBDA_REPLACE 1.948f
#include "libavcodec/aaccoder_trellis.h"
/**
* structure used in optimal codebook search
*/
typedef struct BandCodingPath {
int prev_idx; ///< pointer to the previous path point
float cost; ///< path cost
int run;
} BandCodingPath;
/**
* Encode band info for single window group bands.
*/
static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
BandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
const int run_esc = (1 << run_bits) - 1;
int idx, ppos, count;
int stackrun[120], stackcb[120], stack_len;
float next_minrd = INFINITY;
int next_mincb = 0;
s->abs_pow34(s->scoefs, sce->coeffs, 1024);
start = win*128;
for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[0][cb].cost = 0.0f;
path[0][cb].prev_idx = -1;
path[0][cb].run = 0;
}
for (swb = 0; swb < max_sfb; swb++) {
size = sce->ics.swb_sizes[swb];
if (sce->zeroes[win*16 + swb]) {
for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[swb+1][cb].prev_idx = cb;
path[swb+1][cb].cost = path[swb][cb].cost;
path[swb+1][cb].run = path[swb][cb].run + 1;
}
} else {
float minrd = next_minrd;
int mincb = next_mincb;
next_minrd = INFINITY;
next_mincb = 0;
for (cb = 0; cb < CB_TOT_ALL; cb++) {
float cost_stay_here, cost_get_here;
float rd = 0.0f;
if (cb >= 12 && sce->band_type[win*16+swb] < aac_cb_out_map[cb] ||
cb < aac_cb_in_map[sce->band_type[win*16+swb]] && sce->band_type[win*16+swb] > aac_cb_out_map[cb]) {
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].cost = INFINITY;
path[swb+1][cb].run = path[swb][cb].run + 1;
continue;
}
for (w = 0; w < group_len; w++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
rd += quantize_band_cost(s, &sce->coeffs[start + w*128],
&s->scoefs[start + w*128], size,
sce->sf_idx[(win+w)*16+swb], aac_cb_out_map[cb],
lambda / band->threshold, INFINITY, NULL, NULL, 0);
}
cost_stay_here = path[swb][cb].cost + rd;
cost_get_here = minrd + rd + run_bits + 4;
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
cost_stay_here += run_bits;
if (cost_get_here < cost_stay_here) {
path[swb+1][cb].prev_idx = mincb;
path[swb+1][cb].cost = cost_get_here;
path[swb+1][cb].run = 1;
} else {
path[swb+1][cb].prev_idx = cb;
path[swb+1][cb].cost = cost_stay_here;
path[swb+1][cb].run = path[swb][cb].run + 1;
}
if (path[swb+1][cb].cost < next_minrd) {
next_minrd = path[swb+1][cb].cost;
next_mincb = cb;
}
}
}
start += sce->ics.swb_sizes[swb];
}
//convert resulting path from backward-linked list
stack_len = 0;
idx = 0;
for (cb = 1; cb < CB_TOT_ALL; cb++)
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
idx = cb;
ppos = max_sfb;
while (ppos > 0) {
av_assert1(idx >= 0);
cb = idx;
stackrun[stack_len] = path[ppos][cb].run;
stackcb [stack_len] = cb;
idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
ppos -= path[ppos][cb].run;
stack_len++;
}
//perform actual band info encoding
start = 0;
for (i = stack_len - 1; i >= 0; i--) {
cb = aac_cb_out_map[stackcb[i]];
put_bits(&s->pb, 4, cb);
count = stackrun[i];
memset(sce->zeroes + win*16 + start, !cb, count);
//XXX: memset when band_type is also uint8_t
for (j = 0; j < count; j++) {
sce->band_type[win*16 + start] = cb;
start++;
}
while (count >= run_esc) {
put_bits(&s->pb, run_bits, run_esc);
count -= run_esc;
}
put_bits(&s->pb, run_bits, count);
}
}
typedef struct TrellisPath {
float cost;
int prev;
} TrellisPath;
#define TRELLIS_STAGES 121
#define TRELLIS_STATES (SCALE_MAX_DIFF+1)
static void set_special_band_scalefactors(AACEncContext *s, SingleChannelElement *sce)
{
int w, g;
int prevscaler_n = -255, prevscaler_i = 0;
int bands = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (sce->zeroes[w*16+g])
continue;
if (sce->band_type[w*16+g] == INTENSITY_BT || sce->band_type[w*16+g] == INTENSITY_BT2) {
sce->sf_idx[w*16+g] = av_clip(roundf(log2f(sce->is_ener[w*16+g])*2), -155, 100);
bands++;
} else if (sce->band_type[w*16+g] == NOISE_BT) {
sce->sf_idx[w*16+g] = av_clip(3+ceilf(log2f(sce->pns_ener[w*16+g])*2), -100, 155);
if (prevscaler_n == -255)
prevscaler_n = sce->sf_idx[w*16+g];
bands++;
}
}
}
if (!bands)
return;
/* Clip the scalefactor indices */
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (sce->zeroes[w*16+g])
continue;
if (sce->band_type[w*16+g] == INTENSITY_BT || sce->band_type[w*16+g] == INTENSITY_BT2) {
sce->sf_idx[w*16+g] = prevscaler_i = av_clip(sce->sf_idx[w*16+g], prevscaler_i - SCALE_MAX_DIFF, prevscaler_i + SCALE_MAX_DIFF);
} else if (sce->band_type[w*16+g] == NOISE_BT) {
sce->sf_idx[w*16+g] = prevscaler_n = av_clip(sce->sf_idx[w*16+g], prevscaler_n - SCALE_MAX_DIFF, prevscaler_n + SCALE_MAX_DIFF);
}
}
}
}
static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce,
const float lambda)
{
int q, w, w2, g, start = 0;
int i, j;
int idx;
TrellisPath paths[TRELLIS_STAGES][TRELLIS_STATES];
int bandaddr[TRELLIS_STAGES];
int minq;
float mincost;
float q0f = FLT_MAX, q1f = 0.0f, qnrgf = 0.0f;
int q0, q1, qcnt = 0;
for (i = 0; i < 1024; i++) {
float t = fabsf(sce->coeffs[i]);
if (t > 0.0f) {
q0f = FFMIN(q0f, t);
q1f = FFMAX(q1f, t);
qnrgf += t*t;
qcnt++;
}
}
if (!qcnt) {
memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
memset(sce->zeroes, 1, sizeof(sce->zeroes));
return;
}
//minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
q0 = av_clip(coef2minsf(q0f), 0, SCALE_MAX_POS-1);
//maximum scalefactor index is when maximum coefficient after quantizing is still not zero
q1 = av_clip(coef2maxsf(q1f), 1, SCALE_MAX_POS);
if (q1 - q0 > 60) {
int q0low = q0;
int q1high = q1;
//minimum scalefactor index is when maximum nonzero coefficient after quantizing is not clipped
int qnrg = av_clip_uint8(log2f(sqrtf(qnrgf/qcnt))*4 - 31 + SCALE_ONE_POS - SCALE_DIV_512);
q1 = qnrg + 30;
q0 = qnrg - 30;
if (q0 < q0low) {
q1 += q0low - q0;
q0 = q0low;
} else if (q1 > q1high) {
q0 -= q1 - q1high;
q1 = q1high;
}
}
// q0 == q1 isn't really a legal situation
if (q0 == q1) {
// the following is indirect but guarantees q1 != q0 && q1 near q0
q1 = av_clip(q0+1, 1, SCALE_MAX_POS);
q0 = av_clip(q1-1, 0, SCALE_MAX_POS - 1);
}
for (i = 0; i < TRELLIS_STATES; i++) {
paths[0][i].cost = 0.0f;
paths[0][i].prev = -1;
}
for (j = 1; j < TRELLIS_STAGES; j++) {
for (i = 0; i < TRELLIS_STATES; i++) {
paths[j][i].cost = INFINITY;
paths[j][i].prev = -2;
}
}
idx = 1;
s->abs_pow34(s->scoefs, sce->coeffs, 1024);
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *coefs = &sce->coeffs[start];
float qmin, qmax;
int nz = 0;
bandaddr[idx] = w * 16 + g;
qmin = INT_MAX;
qmax = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;
}
sce->zeroes[(w+w2)*16+g] = 0;
nz = 1;
for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
float t = fabsf(coefs[w2*128+i]);
if (t > 0.0f)
qmin = FFMIN(qmin, t);
qmax = FFMAX(qmax, t);
}
}
if (nz) {
int minscale, maxscale;
float minrd = INFINITY;
float maxval;
//minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
minscale = coef2minsf(qmin);
//maximum scalefactor index is when maximum coefficient after quantizing is still not zero
maxscale = coef2maxsf(qmax);
minscale = av_clip(minscale - q0, 0, TRELLIS_STATES - 1);
maxscale = av_clip(maxscale - q0, 0, TRELLIS_STATES);
if (minscale == maxscale) {
maxscale = av_clip(minscale+1, 1, TRELLIS_STATES);
minscale = av_clip(maxscale-1, 0, TRELLIS_STATES - 1);
}
maxval = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], s->scoefs+start);
for (q = minscale; q < maxscale; q++) {
float dist = 0;
int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
q + q0, cb, lambda / band->threshold, INFINITY, NULL, NULL, 0);
}
minrd = FFMIN(minrd, dist);
for (i = 0; i < q1 - q0; i++) {
float cost;
cost = paths[idx - 1][i].cost + dist
+ ff_aac_scalefactor_bits[q - i + SCALE_DIFF_ZERO];
if (cost < paths[idx][q].cost) {
paths[idx][q].cost = cost;
paths[idx][q].prev = i;
}
}
}
} else {
for (q = 0; q < q1 - q0; q++) {
paths[idx][q].cost = paths[idx - 1][q].cost + 1;
paths[idx][q].prev = q;
}
}
sce->zeroes[w*16+g] = !nz;
start += sce->ics.swb_sizes[g];
idx++;
}
}
idx--;
mincost = paths[idx][0].cost;
minq = 0;
for (i = 1; i < TRELLIS_STATES; i++) {
if (paths[idx][i].cost < mincost) {
mincost = paths[idx][i].cost;
minq = i;
}
}
while (idx) {
sce->sf_idx[bandaddr[idx]] = minq + q0;
minq = FFMAX(paths[idx][minq].prev, 0);
idx--;
}
//set the same quantizers inside window groups
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
for (g = 0; g < sce->ics.num_swb; g++)
for (w2 = 1; w2 < sce->ics.group_len[w]; w2++)
sce->sf_idx[(w+w2)*16+g] = sce->sf_idx[w*16+g];
}
static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce,
const float lambda)
{
int start = 0, i, w, w2, g;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
float dists[128] = { 0 }, uplims[128] = { 0 };
float maxvals[128];
int fflag, minscaler;
int its = 0;
int allz = 0;
float minthr = INFINITY;
// for values above this the decoder might end up in an endless loop
// due to always having more bits than what can be encoded.
destbits = FFMIN(destbits, 5800);
//some heuristic to determine initial quantizers will reduce search time
//determine zero bands and upper limits
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce->ics.num_swb; g++) {
int nz = 0;
float uplim = 0.0f, energy = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
uplim += band->threshold;
energy += band->energy;
if (band->energy <= band->threshold || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;
}
nz = 1;
}
uplims[w*16+g] = uplim *512;
sce->band_type[w*16+g] = 0;
sce->zeroes[w*16+g] = !nz;
if (nz)
minthr = FFMIN(minthr, uplim);
allz |= nz;
start += sce->ics.swb_sizes[g];
}
}
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (sce->zeroes[w*16+g]) {
sce->sf_idx[w*16+g] = SCALE_ONE_POS;
continue;
}
sce->sf_idx[w*16+g] = SCALE_ONE_POS + FFMIN(log2f(uplims[w*16+g]/minthr)*4,59);
}
}
if (!allz)
return;
s->abs_pow34(s->scoefs, sce->coeffs, 1024);
ff_quantize_band_cost_cache_init(s);
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *scaled = s->scoefs + start;
maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
start += sce->ics.swb_sizes[g];
}
}
//perform two-loop search
//outer loop - improve quality
do {
int tbits, qstep;
minscaler = sce->sf_idx[0];
//inner loop - quantize spectrum to fit into given number of bits
qstep = its ? 1 : 32;
do {
int prev = -1;
tbits = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *coefs = sce->coeffs + start;
const float *scaled = s->scoefs + start;
int bits = 0;
int cb;
float dist = 0.0f;
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
start += sce->ics.swb_sizes[g];
continue;
}
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
dist += quantize_band_cost_cached(s, w + w2, g,
coefs + w2*128,
scaled + w2*128,
sce->ics.swb_sizes[g],
sce->sf_idx[w*16+g],
cb, 1.0f, INFINITY,
&b, NULL, 0);
bits += b;
}
dists[w*16+g] = dist - bits;
if (prev != -1) {
bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];
}
tbits += bits;
start += sce->ics.swb_sizes[g];
prev = sce->sf_idx[w*16+g];
}
}
if (tbits > destbits) {
for (i = 0; i < 128; i++)
if (sce->sf_idx[i] < 218 - qstep)
sce->sf_idx[i] += qstep;
} else {
for (i = 0; i < 128; i++)
if (sce->sf_idx[i] > 60 - qstep)
sce->sf_idx[i] -= qstep;
}
qstep >>= 1;
if (!qstep && tbits > destbits*1.02 && sce->sf_idx[0] < 217)
qstep = 1;
} while (qstep);
fflag = 0;
minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF);
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
int prevsc = sce->sf_idx[w*16+g];
if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) {
if (find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1))
sce->sf_idx[w*16+g]--;
else //Try to make sure there is some energy in every band
sce->sf_idx[w*16+g]-=2;
}
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF);
sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219);
if (sce->sf_idx[w*16+g] != prevsc)
fflag = 1;
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
}
}
its++;
} while (fflag && its < 10);
}
static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce)
{
FFPsyBand *band;
int w, g, w2, i;
int wlen = 1024 / sce->ics.num_windows;
int bandwidth, cutoff;
float *PNS = &s->scoefs[0*128], *PNS34 = &s->scoefs[1*128];
float *NOR34 = &s->scoefs[3*128];
uint8_t nextband[128];
const float lambda = s->lambda;
const float freq_mult = avctx->sample_rate*0.5f/wlen;
const float thr_mult = NOISE_LAMBDA_REPLACE*(100.0f/lambda);
const float spread_threshold = FFMIN(0.75f, NOISE_SPREAD_THRESHOLD*FFMAX(0.5f, lambda/100.f));
const float dist_bias = av_clipf(4.f * 120 / lambda, 0.25f, 4.0f);
const float pns_transient_energy_r = FFMIN(0.7f, lambda / 140.f);
int refbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
/ ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
* (lambda / 120.f);
/** Keep this in sync with twoloop's cutoff selection */
float rate_bandwidth_multiplier = 1.5f;
int prev = -1000, prev_sf = -1;
int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
: (avctx->bit_rate / avctx->channels);
frame_bit_rate *= 1.15f;
if (avctx->cutoff > 0) {
bandwidth = avctx->cutoff;
} else {
bandwidth = FFMAX(3000, AAC_CUTOFF_FROM_BITRATE(frame_bit_rate, 1, avctx->sample_rate));
}
cutoff = bandwidth * 2 * wlen / avctx->sample_rate;
memcpy(sce->band_alt, sce->band_type, sizeof(sce->band_type));
ff_init_nextband_map(sce, nextband);
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
int wstart = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
int noise_sfi;
float dist1 = 0.0f, dist2 = 0.0f, noise_amp;
float pns_energy = 0.0f, pns_tgt_energy, energy_ratio, dist_thresh;
float sfb_energy = 0.0f, threshold = 0.0f, spread = 2.0f;
float min_energy = -1.0f, max_energy = 0.0f;
const int start = wstart+sce->ics.swb_offset[g];
const float freq = (start-wstart)*freq_mult;
const float freq_boost = FFMAX(0.88f*freq/NOISE_LOW_LIMIT, 1.0f);
if (freq < NOISE_LOW_LIMIT || (start-wstart) >= cutoff) {
if (!sce->zeroes[w*16+g])
prev_sf = sce->sf_idx[w*16+g];
continue;
}
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
sfb_energy += band->energy;
spread = FFMIN(spread, band->spread);
threshold += band->threshold;
if (!w2) {
min_energy = max_energy = band->energy;
} else {
min_energy = FFMIN(min_energy, band->energy);
max_energy = FFMAX(max_energy, band->energy);
}
}
/* Ramps down at ~8000Hz and loosens the dist threshold */
dist_thresh = av_clipf(2.5f*NOISE_LOW_LIMIT/freq, 0.5f, 2.5f) * dist_bias;
/* PNS is acceptable when all of these are true:
* 1. high spread energy (noise-like band)
* 2. near-threshold energy (high PE means the random nature of PNS content will be noticed)
* 3. on short window groups, all windows have similar energy (variations in energy would be destroyed by PNS)
*
* At this stage, point 2 is relaxed for zeroed bands near the noise threshold (hole avoidance is more important)
*/
if ((!sce->zeroes[w*16+g] && !ff_sfdelta_can_remove_band(sce, nextband, prev_sf, w*16+g)) ||
((sce->zeroes[w*16+g] || !sce->band_alt[w*16+g]) && sfb_energy < threshold*sqrtf(1.0f/freq_boost)) || spread < spread_threshold ||
(!sce->zeroes[w*16+g] && sce->band_alt[w*16+g] && sfb_energy > threshold*thr_mult*freq_boost) ||
min_energy < pns_transient_energy_r * max_energy ) {
sce->pns_ener[w*16+g] = sfb_energy;
if (!sce->zeroes[w*16+g])
prev_sf = sce->sf_idx[w*16+g];
continue;
}
pns_tgt_energy = sfb_energy*FFMIN(1.0f, spread*spread);
noise_sfi = av_clip(roundf(log2f(pns_tgt_energy)*2), -100, 155); /* Quantize */
noise_amp = -ff_aac_pow2sf_tab[noise_sfi + POW_SF2_ZERO]; /* Dequantize */
if (prev != -1000) {
int noise_sfdiff = noise_sfi - prev + SCALE_DIFF_ZERO;
if (noise_sfdiff < 0 || noise_sfdiff > 2*SCALE_MAX_DIFF) {
if (!sce->zeroes[w*16+g])
prev_sf = sce->sf_idx[w*16+g];
continue;
}
}
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
float band_energy, scale, pns_senergy;
const int start_c = (w+w2)*128+sce->ics.swb_offset[g];
band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
s->random_state = lcg_random(s->random_state);
PNS[i] = s->random_state;
}
band_energy = s->fdsp->scalarproduct_float(PNS, PNS, sce->ics.swb_sizes[g]);
scale = noise_amp/sqrtf(band_energy);
s->fdsp->vector_fmul_scalar(PNS, PNS, scale, sce->ics.swb_sizes[g]);
pns_senergy = s->fdsp->scalarproduct_float(PNS, PNS, sce->ics.swb_sizes[g]);
pns_energy += pns_senergy;
s->abs_pow34(NOR34, &sce->coeffs[start_c], sce->ics.swb_sizes[g]);
s->abs_pow34(PNS34, PNS, sce->ics.swb_sizes[g]);
dist1 += quantize_band_cost(s, &sce->coeffs[start_c],
NOR34,
sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g],
sce->band_alt[(w+w2)*16+g],
lambda/band->threshold, INFINITY, NULL, NULL, 0);
/* Estimate rd on average as 5 bits for SF, 4 for the CB, plus spread energy * lambda/thr */
dist2 += band->energy/(band->spread*band->spread)*lambda*dist_thresh/band->threshold;
}
if (g && sce->band_type[w*16+g-1] == NOISE_BT) {
dist2 += 5;
} else {
dist2 += 9;
}
energy_ratio = pns_tgt_energy/pns_energy; /* Compensates for quantization error */
sce->pns_ener[w*16+g] = energy_ratio*pns_tgt_energy;
if (sce->zeroes[w*16+g] || !sce->band_alt[w*16+g] || (energy_ratio > 0.85f && energy_ratio < 1.25f && dist2 < dist1)) {
sce->band_type[w*16+g] = NOISE_BT;
sce->zeroes[w*16+g] = 0;
prev = noise_sfi;
} else {
if (!sce->zeroes[w*16+g])
prev_sf = sce->sf_idx[w*16+g];
}
}
}
}
static void mark_pns(AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce)
{
FFPsyBand *band;
int w, g, w2;
int wlen = 1024 / sce->ics.num_windows;
int bandwidth, cutoff;
const float lambda = s->lambda;
const float freq_mult = avctx->sample_rate*0.5f/wlen;
const float spread_threshold = FFMIN(0.75f, NOISE_SPREAD_THRESHOLD*FFMAX(0.5f, lambda/100.f));
const float pns_transient_energy_r = FFMIN(0.7f, lambda / 140.f);
int refbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
/ ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
* (lambda / 120.f);
/** Keep this in sync with twoloop's cutoff selection */
float rate_bandwidth_multiplier = 1.5f;
int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
: (avctx->bit_rate / avctx->channels);
frame_bit_rate *= 1.15f;
if (avctx->cutoff > 0) {
bandwidth = avctx->cutoff;
} else {
bandwidth = FFMAX(3000, AAC_CUTOFF_FROM_BITRATE(frame_bit_rate, 1, avctx->sample_rate));
}
cutoff = bandwidth * 2 * wlen / avctx->sample_rate;
memcpy(sce->band_alt, sce->band_type, sizeof(sce->band_type));
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
float sfb_energy = 0.0f, threshold = 0.0f, spread = 2.0f;
float min_energy = -1.0f, max_energy = 0.0f;
const int start = sce->ics.swb_offset[g];
const float freq = start*freq_mult;
const float freq_boost = FFMAX(0.88f*freq/NOISE_LOW_LIMIT, 1.0f);
if (freq < NOISE_LOW_LIMIT || start >= cutoff) {
sce->can_pns[w*16+g] = 0;
continue;
}
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
sfb_energy += band->energy;
spread = FFMIN(spread, band->spread);
threshold += band->threshold;
if (!w2) {
min_energy = max_energy = band->energy;
} else {
min_energy = FFMIN(min_energy, band->energy);
max_energy = FFMAX(max_energy, band->energy);
}
}
/* PNS is acceptable when all of these are true:
* 1. high spread energy (noise-like band)
* 2. near-threshold energy (high PE means the random nature of PNS content will be noticed)
* 3. on short window groups, all windows have similar energy (variations in energy would be destroyed by PNS)
*/
sce->pns_ener[w*16+g] = sfb_energy;
if (sfb_energy < threshold*sqrtf(1.5f/freq_boost) || spread < spread_threshold || min_energy < pns_transient_energy_r * max_energy) {
sce->can_pns[w*16+g] = 0;
} else {
sce->can_pns[w*16+g] = 1;
}
}
}
}
static void search_for_ms(AACEncContext *s, ChannelElement *cpe)
{
int start = 0, i, w, w2, g, sid_sf_boost, prev_mid, prev_side;
uint8_t nextband0[128], nextband1[128];
float *M = s->scoefs + 128*0, *S = s->scoefs + 128*1;
float *L34 = s->scoefs + 128*2, *R34 = s->scoefs + 128*3;
float *M34 = s->scoefs + 128*4, *S34 = s->scoefs + 128*5;
const float lambda = s->lambda;
const float mslambda = FFMIN(1.0f, lambda / 120.f);
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
if (!cpe->common_window)
return;
/** Scout out next nonzero bands */
ff_init_nextband_map(sce0, nextband0);
ff_init_nextband_map(sce1, nextband1);
prev_mid = sce0->sf_idx[0];
prev_side = sce1->sf_idx[0];
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce0->ics.num_swb; g++) {
float bmax = bval2bmax(g * 17.0f / sce0->ics.num_swb) / 0.0045f;
if (!cpe->is_mask[w*16+g])
cpe->ms_mask[w*16+g] = 0;
if (!sce0->zeroes[w*16+g] && !sce1->zeroes[w*16+g] && !cpe->is_mask[w*16+g]) {
float Mmax = 0.0f, Smax = 0.0f;
/* Must compute mid/side SF and book for the whole window group */
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
M[i] = (sce0->coeffs[start+(w+w2)*128+i]
+ sce1->coeffs[start+(w+w2)*128+i]) * 0.5;
S[i] = M[i]
- sce1->coeffs[start+(w+w2)*128+i];
}
s->abs_pow34(M34, M, sce0->ics.swb_sizes[g]);
s->abs_pow34(S34, S, sce0->ics.swb_sizes[g]);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++ ) {
Mmax = FFMAX(Mmax, M34[i]);
Smax = FFMAX(Smax, S34[i]);
}
}
for (sid_sf_boost = 0; sid_sf_boost < 4; sid_sf_boost++) {
float dist1 = 0.0f, dist2 = 0.0f;
int B0 = 0, B1 = 0;
int minidx;
int mididx, sididx;
int midcb, sidcb;
minidx = FFMIN(sce0->sf_idx[w*16+g], sce1->sf_idx[w*16+g]);
mididx = av_clip(minidx, 0, SCALE_MAX_POS - SCALE_DIV_512);
sididx = av_clip(minidx - sid_sf_boost * 3, 0, SCALE_MAX_POS - SCALE_DIV_512);
if (sce0->band_type[w*16+g] != NOISE_BT && sce1->band_type[w*16+g] != NOISE_BT
&& ( !ff_sfdelta_can_replace(sce0, nextband0, prev_mid, mididx, w*16+g)
|| !ff_sfdelta_can_replace(sce1, nextband1, prev_side, sididx, w*16+g))) {
/* scalefactor range violation, bad stuff, will decrease quality unacceptably */
continue;
}
midcb = find_min_book(Mmax, mididx);
sidcb = find_min_book(Smax, sididx);
/* No CB can be zero */
midcb = FFMAX(1,midcb);
sidcb = FFMAX(1,sidcb);
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
float minthr = FFMIN(band0->threshold, band1->threshold);
int b1,b2,b3,b4;
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
M[i] = (sce0->coeffs[start+(w+w2)*128+i]
+ sce1->coeffs[start+(w+w2)*128+i]) * 0.5;
S[i] = M[i]
- sce1->coeffs[start+(w+w2)*128+i];
}
s->abs_pow34(L34, sce0->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
s->abs_pow34(R34, sce1->coeffs+start+(w+w2)*128, sce0->ics.swb_sizes[g]);
s->abs_pow34(M34, M, sce0->ics.swb_sizes[g]);
s->abs_pow34(S34, S, sce0->ics.swb_sizes[g]);
dist1 += quantize_band_cost(s, &sce0->coeffs[start + (w+w2)*128],
L34,
sce0->ics.swb_sizes[g],
sce0->sf_idx[w*16+g],
sce0->band_type[w*16+g],
lambda / band0->threshold, INFINITY, &b1, NULL, 0);
dist1 += quantize_band_cost(s, &sce1->coeffs[start + (w+w2)*128],
R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[w*16+g],
sce1->band_type[w*16+g],
lambda / band1->threshold, INFINITY, &b2, NULL, 0);
dist2 += quantize_band_cost(s, M,
M34,
sce0->ics.swb_sizes[g],
mididx,
midcb,
lambda / minthr, INFINITY, &b3, NULL, 0);
dist2 += quantize_band_cost(s, S,
S34,
sce1->ics.swb_sizes[g],
sididx,
sidcb,
mslambda / (minthr * bmax), INFINITY, &b4, NULL, 0);
B0 += b1+b2;
B1 += b3+b4;
dist1 -= b1+b2;
dist2 -= b3+b4;
}
cpe->ms_mask[w*16+g] = dist2 <= dist1 && B1 < B0;
if (cpe->ms_mask[w*16+g]) {
if (sce0->band_type[w*16+g] != NOISE_BT && sce1->band_type[w*16+g] != NOISE_BT) {
sce0->sf_idx[w*16+g] = mididx;
sce1->sf_idx[w*16+g] = sididx;
sce0->band_type[w*16+g] = midcb;
sce1->band_type[w*16+g] = sidcb;
} else if ((sce0->band_type[w*16+g] != NOISE_BT) ^ (sce1->band_type[w*16+g] != NOISE_BT)) {
/* ms_mask unneeded, and it confuses some decoders */
cpe->ms_mask[w*16+g] = 0;
}
break;
} else if (B1 > B0) {
/* More boost won't fix this */
break;
}
}
}
if (!sce0->zeroes[w*16+g] && sce0->band_type[w*16+g] < RESERVED_BT)
prev_mid = sce0->sf_idx[w*16+g];
if (!sce1->zeroes[w*16+g] && !cpe->is_mask[w*16+g] && sce1->band_type[w*16+g] < RESERVED_BT)
prev_side = sce1->sf_idx[w*16+g];
start += sce0->ics.swb_sizes[g];
}
}
}
const AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
[AAC_CODER_ANMR] = {
search_for_quantizers_anmr,
encode_window_bands_info,
quantize_and_encode_band,
ff_aac_encode_tns_info,
ff_aac_encode_ltp_info,
ff_aac_encode_main_pred,
ff_aac_adjust_common_pred,
ff_aac_adjust_common_ltp,
ff_aac_apply_main_pred,
ff_aac_apply_tns,
ff_aac_update_ltp,
ff_aac_ltp_insert_new_frame,
set_special_band_scalefactors,
search_for_pns,
mark_pns,
ff_aac_search_for_tns,
ff_aac_search_for_ltp,
search_for_ms,
ff_aac_search_for_is,
ff_aac_search_for_pred,
},
[AAC_CODER_TWOLOOP] = {
search_for_quantizers_twoloop,
codebook_trellis_rate,
quantize_and_encode_band,
ff_aac_encode_tns_info,
ff_aac_encode_ltp_info,
ff_aac_encode_main_pred,
ff_aac_adjust_common_pred,
ff_aac_adjust_common_ltp,
ff_aac_apply_main_pred,
ff_aac_apply_tns,
ff_aac_update_ltp,
ff_aac_ltp_insert_new_frame,
set_special_band_scalefactors,
search_for_pns,
mark_pns,
ff_aac_search_for_tns,
ff_aac_search_for_ltp,
search_for_ms,
ff_aac_search_for_is,
ff_aac_search_for_pred,
},
[AAC_CODER_FAST] = {
search_for_quantizers_fast,
codebook_trellis_rate,
quantize_and_encode_band,
ff_aac_encode_tns_info,
ff_aac_encode_ltp_info,
ff_aac_encode_main_pred,
ff_aac_adjust_common_pred,
ff_aac_adjust_common_ltp,
ff_aac_apply_main_pred,
ff_aac_apply_tns,
ff_aac_update_ltp,
ff_aac_ltp_insert_new_frame,
set_special_band_scalefactors,
search_for_pns,
mark_pns,
ff_aac_search_for_tns,
ff_aac_search_for_ltp,
search_for_ms,
ff_aac_search_for_is,
ff_aac_search_for_pred,
},
};

View file

@ -0,0 +1,192 @@
/*
* AAC encoder trellis codebook selector
* Copyright (C) 2008-2009 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder trellis codebook selector
* @author Konstantin Shishkov
*/
/**
* This file contains a template for the codebook_trellis_rate selector function.
* It needs to be provided, externally, as an already included declaration,
* the following functions from aacenc_quantization/util.h. They're not included
* explicitly here to make it possible to provide alternative implementations:
* - quantize_band_cost_bits
* - abs_pow34_v
*/
#ifndef AVCODEC_AACCODER_TRELLIS_H
#define AVCODEC_AACCODER_TRELLIS_H
#include <float.h>
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
#include "aacenctab.h"
/**
* structure used in optimal codebook search
*/
typedef struct TrellisBandCodingPath {
int prev_idx; ///< pointer to the previous path point
float cost; ///< path cost
int run;
} TrellisBandCodingPath;
static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda)
{
TrellisBandCodingPath path[120][CB_TOT_ALL];
int w, swb, cb, start, size;
int i, j;
const int max_sfb = sce->ics.max_sfb;
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
const int run_esc = (1 << run_bits) - 1;
int idx, ppos, count;
int stackrun[120], stackcb[120], stack_len;
float next_minbits = INFINITY;
int next_mincb = 0;
s->abs_pow34(s->scoefs, sce->coeffs, 1024);
start = win*128;
for (cb = 0; cb < CB_TOT_ALL; cb++) {
path[0][cb].cost = run_bits+4;
path[0][cb].prev_idx = -1;
path[0][cb].run = 0;
}
for (swb = 0; swb < max_sfb; swb++) {
size = sce->ics.swb_sizes[swb];
if (sce->zeroes[win*16 + swb]) {
float cost_stay_here = path[swb][0].cost;
float cost_get_here = next_minbits + run_bits + 4;
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
!= run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
cost_stay_here += run_bits;
if (cost_get_here < cost_stay_here) {
path[swb+1][0].prev_idx = next_mincb;
path[swb+1][0].cost = cost_get_here;
path[swb+1][0].run = 1;
} else {
path[swb+1][0].prev_idx = 0;
path[swb+1][0].cost = cost_stay_here;
path[swb+1][0].run = path[swb][0].run + 1;
}
next_minbits = path[swb+1][0].cost;
next_mincb = 0;
for (cb = 1; cb < CB_TOT_ALL; cb++) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
}
} else {
float minbits = next_minbits;
int mincb = next_mincb;
int startcb = sce->band_type[win*16+swb];
startcb = aac_cb_in_map[startcb];
next_minbits = INFINITY;
next_mincb = 0;
for (cb = 0; cb < startcb; cb++) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
}
for (cb = startcb; cb < CB_TOT_ALL; cb++) {
float cost_stay_here, cost_get_here;
float bits = 0.0f;
if (cb >= 12 && sce->band_type[win*16+swb] != aac_cb_out_map[cb]) {
path[swb+1][cb].cost = 61450;
path[swb+1][cb].prev_idx = -1;
path[swb+1][cb].run = 0;
continue;
}
for (w = 0; w < group_len; w++) {
bits += quantize_band_cost_bits(s, &sce->coeffs[start + w*128],
&s->scoefs[start + w*128], size,
sce->sf_idx[win*16+swb],
aac_cb_out_map[cb],
0, INFINITY, NULL, NULL, 0);
}
cost_stay_here = path[swb][cb].cost + bits;
cost_get_here = minbits + bits + run_bits + 4;
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run]
!= run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1])
cost_stay_here += run_bits;
if (cost_get_here < cost_stay_here) {
path[swb+1][cb].prev_idx = mincb;
path[swb+1][cb].cost = cost_get_here;
path[swb+1][cb].run = 1;
} else {
path[swb+1][cb].prev_idx = cb;
path[swb+1][cb].cost = cost_stay_here;
path[swb+1][cb].run = path[swb][cb].run + 1;
}
if (path[swb+1][cb].cost < next_minbits) {
next_minbits = path[swb+1][cb].cost;
next_mincb = cb;
}
}
}
start += sce->ics.swb_sizes[swb];
}
//convert resulting path from backward-linked list
stack_len = 0;
idx = 0;
for (cb = 1; cb < CB_TOT_ALL; cb++)
if (path[max_sfb][cb].cost < path[max_sfb][idx].cost)
idx = cb;
ppos = max_sfb;
while (ppos > 0) {
av_assert1(idx >= 0);
cb = idx;
stackrun[stack_len] = path[ppos][cb].run;
stackcb [stack_len] = cb;
idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx;
ppos -= path[ppos][cb].run;
stack_len++;
}
//perform actual band info encoding
start = 0;
for (i = stack_len - 1; i >= 0; i--) {
cb = aac_cb_out_map[stackcb[i]];
put_bits(&s->pb, 4, cb);
count = stackrun[i];
memset(sce->zeroes + win*16 + start, !cb, count);
//XXX: memset when band_type is also uint8_t
for (j = 0; j < count; j++) {
sce->band_type[win*16 + start] = cb;
start++;
}
while (count >= run_esc) {
put_bits(&s->pb, run_bits, run_esc);
count -= run_esc;
}
put_bits(&s->pb, run_bits, count);
}
}
#endif /* AVCODEC_AACCODER_TRELLIS_H */

View file

@ -0,0 +1,763 @@
/*
* AAC encoder twoloop coder
* Copyright (C) 2008-2009 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder twoloop coder
* @author Konstantin Shishkov, Claudio Freire
*/
/**
* This file contains a template for the twoloop coder function.
* It needs to be provided, externally, as an already included declaration,
* the following functions from aacenc_quantization/util.h. They're not included
* explicitly here to make it possible to provide alternative implementations:
* - quantize_band_cost
* - abs_pow34_v
* - find_max_val
* - find_min_book
* - find_form_factor
*/
#ifndef AVCODEC_AACCODER_TWOLOOP_H
#define AVCODEC_AACCODER_TWOLOOP_H
#include <float.h>
#include "libavutil/mathematics.h"
#include "mathops.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
#include "aacenctab.h"
/** Frequency in Hz for lower limit of noise substitution **/
#define NOISE_LOW_LIMIT 4000
#define sclip(x) av_clip(x,60,218)
/* Reflects the cost to change codebooks */
static inline int ff_pns_bits(SingleChannelElement *sce, int w, int g)
{
return (!g || !sce->zeroes[w*16+g-1] || !sce->can_pns[w*16+g-1]) ? 9 : 5;
}
/**
* two-loop quantizers search taken from ISO 13818-7 Appendix C
*/
static void search_for_quantizers_twoloop(AVCodecContext *avctx,
AACEncContext *s,
SingleChannelElement *sce,
const float lambda)
{
int start = 0, i, w, w2, g, recomprd;
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
/ ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
* (lambda / 120.f);
int refbits = destbits;
int toomanybits, toofewbits;
char nzs[128];
uint8_t nextband[128];
int maxsf[128], minsf[128];
float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], euplims[128], energies[128];
float maxvals[128], spread_thr_r[128];
float min_spread_thr_r, max_spread_thr_r;
/**
* rdlambda controls the maximum tolerated distortion. Twoloop
* will keep iterating until it fails to lower it or it reaches
* ulimit * rdlambda. Keeping it low increases quality on difficult
* signals, but lower it too much, and bits will be taken from weak
* signals, creating "holes". A balance is necessary.
* rdmax and rdmin specify the relative deviation from rdlambda
* allowed for tonality compensation
*/
float rdlambda = av_clipf(2.0f * 120.f / lambda, 0.0625f, 16.0f);
const float nzslope = 1.5f;
float rdmin = 0.03125f;
float rdmax = 1.0f;
/**
* sfoffs controls an offset of optmium allocation that will be
* applied based on lambda. Keep it real and modest, the loop
* will take care of the rest, this just accelerates convergence
*/
float sfoffs = av_clipf(log2f(120.0f / lambda) * 4.0f, -5, 10);
int fflag, minscaler, maxscaler, nminscaler;
int its = 0;
int maxits = 30;
int allz = 0;
int tbits;
int cutoff = 1024;
int pns_start_pos;
int prev;
/**
* zeroscale controls a multiplier of the threshold, if band energy
* is below this, a zero is forced. Keep it lower than 1, unless
* low lambda is used, because energy < threshold doesn't mean there's
* no audible signal outright, it's just energy. Also make it rise
* slower than rdlambda, as rdscale has due compensation with
* noisy band depriorization below, whereas zeroing logic is rather dumb
*/
float zeroscale;
if (lambda > 120.f) {
zeroscale = av_clipf(powf(120.f / lambda, 0.25f), 0.0625f, 1.0f);
} else {
zeroscale = 1.f;
}
if (s->psy.bitres.alloc >= 0) {
/**
* Psy granted us extra bits to use, from the reservoire
* adjust for lambda except what psy already did
*/
destbits = s->psy.bitres.alloc
* (lambda / (avctx->global_quality ? avctx->global_quality : 120));
}
if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
/**
* Constant Q-scale doesn't compensate MS coding on its own
* No need to be overly precise, this only controls RD
* adjustment CB limits when going overboard
*/
if (s->options.mid_side && s->cur_type == TYPE_CPE)
destbits *= 2;
/**
* When using a constant Q-scale, don't adjust bits, just use RD
* Don't let it go overboard, though... 8x psy target is enough
*/
toomanybits = 5800;
toofewbits = destbits / 16;
/** Don't offset scalers, just RD */
sfoffs = sce->ics.num_windows - 1;
rdlambda = sqrtf(rdlambda);
/** search further */
maxits *= 2;
} else {
/* When using ABR, be strict, but a reasonable leeway is
* critical to allow RC to smoothly track desired bitrate
* without sudden quality drops that cause audible artifacts.
* Symmetry is also desirable, to avoid systematic bias.
*/
toomanybits = destbits + destbits/8;
toofewbits = destbits - destbits/8;
sfoffs = 0;
rdlambda = sqrtf(rdlambda);
}
/** and zero out above cutoff frequency */
{
int wlen = 1024 / sce->ics.num_windows;
int bandwidth;
/**
* Scale, psy gives us constant quality, this LP only scales
* bitrate by lambda, so we save bits on subjectively unimportant HF
* rather than increase quantization noise. Adjust nominal bitrate
* to effective bitrate according to encoding parameters,
* AAC_CUTOFF_FROM_BITRATE is calibrated for effective bitrate.
*/
float rate_bandwidth_multiplier = 1.5f;
int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
: (avctx->bit_rate / avctx->channels);
/** Compensate for extensions that increase efficiency */
if (s->options.pns || s->options.intensity_stereo)
frame_bit_rate *= 1.15f;
if (avctx->cutoff > 0) {
bandwidth = avctx->cutoff;
} else {
bandwidth = FFMAX(3000, AAC_CUTOFF_FROM_BITRATE(frame_bit_rate, 1, avctx->sample_rate));
s->psy.cutoff = bandwidth;
}
cutoff = bandwidth * 2 * wlen / avctx->sample_rate;
pns_start_pos = NOISE_LOW_LIMIT * 2 * wlen / avctx->sample_rate;
}
/**
* for values above this the decoder might end up in an endless loop
* due to always having more bits than what can be encoded.
*/
destbits = FFMIN(destbits, 5800);
toomanybits = FFMIN(toomanybits, 5800);
toofewbits = FFMIN(toofewbits, 5800);
/**
* XXX: some heuristic to determine initial quantizers will reduce search time
* determine zero bands and upper distortion limits
*/
min_spread_thr_r = -1;
max_spread_thr_r = -1;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
int nz = 0;
float uplim = 0.0f, energy = 0.0f, spread = 0.0f;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
if (start >= cutoff || band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f) {
sce->zeroes[(w+w2)*16+g] = 1;
continue;
}
nz = 1;
}
if (!nz) {
uplim = 0.0f;
} else {
nz = 0;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
if (band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f)
continue;
uplim += band->threshold;
energy += band->energy;
spread += band->spread;
nz++;
}
}
uplims[w*16+g] = uplim;
energies[w*16+g] = energy;
nzs[w*16+g] = nz;
sce->zeroes[w*16+g] = !nz;
allz |= nz;
if (nz && sce->can_pns[w*16+g]) {
spread_thr_r[w*16+g] = energy * nz / (uplim * spread);
if (min_spread_thr_r < 0) {
min_spread_thr_r = max_spread_thr_r = spread_thr_r[w*16+g];
} else {
min_spread_thr_r = FFMIN(min_spread_thr_r, spread_thr_r[w*16+g]);
max_spread_thr_r = FFMAX(max_spread_thr_r, spread_thr_r[w*16+g]);
}
}
}
}
/** Compute initial scalers */
minscaler = 65535;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (sce->zeroes[w*16+g]) {
sce->sf_idx[w*16+g] = SCALE_ONE_POS;
continue;
}
/**
* log2f-to-distortion ratio is, technically, 2 (1.5db = 4, but it's power vs level so it's 2).
* But, as offsets are applied, low-frequency signals are too sensitive to the induced distortion,
* so we make scaling more conservative by choosing a lower log2f-to-distortion ratio, and thus
* more robust.
*/
sce->sf_idx[w*16+g] = av_clip(
SCALE_ONE_POS
+ 1.75*log2f(FFMAX(0.00125f,uplims[w*16+g]) / sce->ics.swb_sizes[g])
+ sfoffs,
60, SCALE_MAX_POS);
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
}
}
/** Clip */
minscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512);
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
for (g = 0; g < sce->ics.num_swb; g++)
if (!sce->zeroes[w*16+g])
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF - 1);
if (!allz)
return;
s->abs_pow34(s->scoefs, sce->coeffs, 1024);
ff_quantize_band_cost_cache_init(s);
for (i = 0; i < sizeof(minsf) / sizeof(minsf[0]); ++i)
minsf[i] = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *scaled = s->scoefs + start;
int minsfidx;
maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled);
if (maxvals[w*16+g] > 0) {
minsfidx = coef2minsf(maxvals[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
minsf[(w+w2)*16+g] = minsfidx;
}
start += sce->ics.swb_sizes[g];
}
}
/**
* Scale uplims to match rate distortion to quality
* bu applying noisy band depriorization and tonal band priorization.
* Maxval-energy ratio gives us an idea of how noisy/tonal the band is.
* If maxval^2 ~ energy, then that band is mostly noise, and we can relax
* rate distortion requirements.
*/
memcpy(euplims, uplims, sizeof(euplims));
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
/** psy already priorizes transients to some extent */
float de_psy_factor = (sce->ics.num_windows > 1) ? 8.0f / sce->ics.group_len[w] : 1.0f;
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
if (nzs[g] > 0) {
float cleanup_factor = ff_sqrf(av_clipf(start / (cutoff * 0.75f), 1.0f, 2.0f));
float energy2uplim = find_form_factor(
sce->ics.group_len[w], sce->ics.swb_sizes[g],
uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]),
sce->coeffs + start,
nzslope * cleanup_factor);
energy2uplim *= de_psy_factor;
if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
/** In ABR, we need to priorize less and let rate control do its thing */
energy2uplim = sqrtf(energy2uplim);
}
energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim));
uplims[w*16+g] *= av_clipf(rdlambda * energy2uplim, rdmin, rdmax)
* sce->ics.group_len[w];
energy2uplim = find_form_factor(
sce->ics.group_len[w], sce->ics.swb_sizes[g],
uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]),
sce->coeffs + start,
2.0f);
energy2uplim *= de_psy_factor;
if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
/** In ABR, we need to priorize less and let rate control do its thing */
energy2uplim = sqrtf(energy2uplim);
}
energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim));
euplims[w*16+g] *= av_clipf(rdlambda * energy2uplim * sce->ics.group_len[w],
0.5f, 1.0f);
}
start += sce->ics.swb_sizes[g];
}
}
for (i = 0; i < sizeof(maxsf) / sizeof(maxsf[0]); ++i)
maxsf[i] = SCALE_MAX_POS;
//perform two-loop search
//outer loop - improve quality
do {
//inner loop - quantize spectrum to fit into given number of bits
int overdist;
int qstep = its ? 1 : 32;
do {
int changed = 0;
prev = -1;
recomprd = 0;
tbits = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *coefs = &sce->coeffs[start];
const float *scaled = &s->scoefs[start];
int bits = 0;
int cb;
float dist = 0.0f;
float qenergy = 0.0f;
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
start += sce->ics.swb_sizes[g];
if (sce->can_pns[w*16+g]) {
/** PNS isn't free */
tbits += ff_pns_bits(sce, w, g);
}
continue;
}
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
float sqenergy;
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
scaled + w2*128,
sce->ics.swb_sizes[g],
sce->sf_idx[w*16+g],
cb,
1.0f,
INFINITY,
&b, &sqenergy,
0);
bits += b;
qenergy += sqenergy;
}
dists[w*16+g] = dist - bits;
qenergies[w*16+g] = qenergy;
if (prev != -1) {
int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF);
bits += ff_aac_scalefactor_bits[sfdiff];
}
tbits += bits;
start += sce->ics.swb_sizes[g];
prev = sce->sf_idx[w*16+g];
}
}
if (tbits > toomanybits) {
recomprd = 1;
for (i = 0; i < 128; i++) {
if (sce->sf_idx[i] < (SCALE_MAX_POS - SCALE_DIV_512)) {
int maxsf_i = (tbits > 5800) ? SCALE_MAX_POS : maxsf[i];
int new_sf = FFMIN(maxsf_i, sce->sf_idx[i] + qstep);
if (new_sf != sce->sf_idx[i]) {
sce->sf_idx[i] = new_sf;
changed = 1;
}
}
}
} else if (tbits < toofewbits) {
recomprd = 1;
for (i = 0; i < 128; i++) {
if (sce->sf_idx[i] > SCALE_ONE_POS) {
int new_sf = FFMAX3(minsf[i], SCALE_ONE_POS, sce->sf_idx[i] - qstep);
if (new_sf != sce->sf_idx[i]) {
sce->sf_idx[i] = new_sf;
changed = 1;
}
}
}
}
qstep >>= 1;
if (!qstep && tbits > toomanybits && sce->sf_idx[0] < 217 && changed)
qstep = 1;
} while (qstep);
overdist = 1;
fflag = tbits < toofewbits;
for (i = 0; i < 2 && (overdist || recomprd); ++i) {
if (recomprd) {
/** Must recompute distortion */
prev = -1;
tbits = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
const float *coefs = sce->coeffs + start;
const float *scaled = s->scoefs + start;
int bits = 0;
int cb;
float dist = 0.0f;
float qenergy = 0.0f;
if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
start += sce->ics.swb_sizes[g];
if (sce->can_pns[w*16+g]) {
/** PNS isn't free */
tbits += ff_pns_bits(sce, w, g);
}
continue;
}
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
float sqenergy;
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
scaled + w2*128,
sce->ics.swb_sizes[g],
sce->sf_idx[w*16+g],
cb,
1.0f,
INFINITY,
&b, &sqenergy,
0);
bits += b;
qenergy += sqenergy;
}
dists[w*16+g] = dist - bits;
qenergies[w*16+g] = qenergy;
if (prev != -1) {
int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF);
bits += ff_aac_scalefactor_bits[sfdiff];
}
tbits += bits;
start += sce->ics.swb_sizes[g];
prev = sce->sf_idx[w*16+g];
}
}
}
if (!i && s->options.pns && its > maxits/2 && tbits > toofewbits) {
float maxoverdist = 0.0f;
float ovrfactor = 1.f+(maxits-its)*16.f/maxits;
overdist = recomprd = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
if (!sce->zeroes[w*16+g] && sce->sf_idx[w*16+g] > SCALE_ONE_POS && dists[w*16+g] > uplims[w*16+g]*ovrfactor) {
float ovrdist = dists[w*16+g] / FFMAX(uplims[w*16+g],euplims[w*16+g]);
maxoverdist = FFMAX(maxoverdist, ovrdist);
overdist++;
}
}
}
if (overdist) {
/* We have overdistorted bands, trade for zeroes (that can be noise)
* Zero the bands in the lowest 1.25% spread-energy-threshold ranking
*/
float minspread = max_spread_thr_r;
float maxspread = min_spread_thr_r;
float zspread;
int zeroable = 0;
int zeroed = 0;
int maxzeroed, zloop;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) {
if (start >= pns_start_pos && !sce->zeroes[w*16+g] && sce->can_pns[w*16+g]) {
minspread = FFMIN(minspread, spread_thr_r[w*16+g]);
maxspread = FFMAX(maxspread, spread_thr_r[w*16+g]);
zeroable++;
}
}
}
zspread = (maxspread-minspread) * 0.0125f + minspread;
/* Don't PNS everything even if allowed. It suppresses bit starvation signals from RC,
* and forced the hand of the later search_for_pns step.
* Instead, PNS a fraction of the spread_thr_r range depending on how starved for bits we are,
* and leave further PNSing to search_for_pns if worthwhile.
*/
zspread = FFMIN3(min_spread_thr_r * 8.f, zspread,
((toomanybits - tbits) * min_spread_thr_r + (tbits - toofewbits) * max_spread_thr_r) / (toomanybits - toofewbits + 1));
maxzeroed = FFMIN(zeroable, FFMAX(1, (zeroable * its + maxits - 1) / (2 * maxits)));
for (zloop = 0; zloop < 2; zloop++) {
/* Two passes: first distorted stuff - two birds in one shot and all that,
* then anything viable. Viable means not zero, but either CB=zero-able
* (too high SF), not SF <= 1 (that means we'd be operating at very high
* quality, we don't want PNS when doing VHQ), PNS allowed, and within
* the lowest ranking percentile.
*/
float loopovrfactor = (zloop) ? 1.0f : ovrfactor;
int loopminsf = (zloop) ? (SCALE_ONE_POS - SCALE_DIV_512) : SCALE_ONE_POS;
int mcb;
for (g = sce->ics.num_swb-1; g > 0 && zeroed < maxzeroed; g--) {
if (sce->ics.swb_offset[g] < pns_start_pos)
continue;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
if (!sce->zeroes[w*16+g] && sce->can_pns[w*16+g] && spread_thr_r[w*16+g] <= zspread
&& sce->sf_idx[w*16+g] > loopminsf
&& (dists[w*16+g] > loopovrfactor*uplims[w*16+g] || !(mcb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]))
|| (mcb <= 1 && dists[w*16+g] > FFMIN(uplims[w*16+g], euplims[w*16+g]))) ) {
sce->zeroes[w*16+g] = 1;
sce->band_type[w*16+g] = 0;
zeroed++;
}
}
}
}
if (zeroed)
recomprd = fflag = 1;
} else {
overdist = 0;
}
}
}
minscaler = SCALE_MAX_POS;
maxscaler = 0;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (!sce->zeroes[w*16+g]) {
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
maxscaler = FFMAX(maxscaler, sce->sf_idx[w*16+g]);
}
}
}
minscaler = nminscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512);
prev = -1;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
/** Start with big steps, end up fine-tunning */
int depth = (its > maxits/2) ? ((its > maxits*2/3) ? 1 : 3) : 10;
int edepth = depth+2;
float uplmax = its / (maxits*0.25f) + 1.0f;
uplmax *= (tbits > destbits) ? FFMIN(2.0f, tbits / (float)FFMAX(1,destbits)) : 1.0f;
start = w * 128;
for (g = 0; g < sce->ics.num_swb; g++) {
int prevsc = sce->sf_idx[w*16+g];
if (prev < 0 && !sce->zeroes[w*16+g])
prev = sce->sf_idx[0];
if (!sce->zeroes[w*16+g]) {
const float *coefs = sce->coeffs + start;
const float *scaled = s->scoefs + start;
int cmb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
int mindeltasf = FFMAX(0, prev - SCALE_MAX_DIFF);
int maxdeltasf = FFMIN(SCALE_MAX_POS - SCALE_DIV_512, prev + SCALE_MAX_DIFF);
if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > FFMAX(mindeltasf, minsf[w*16+g])) {
/* Try to make sure there is some energy in every nonzero band
* NOTE: This algorithm must be forcibly imbalanced, pushing harder
* on holes or more distorted bands at first, otherwise there's
* no net gain (since the next iteration will offset all bands
* on the opposite direction to compensate for extra bits)
*/
for (i = 0; i < edepth && sce->sf_idx[w*16+g] > mindeltasf; ++i) {
int cb, bits;
float dist, qenergy;
int mb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1);
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
dist = qenergy = 0.f;
bits = 0;
if (!cb) {
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g]-1, maxsf[w*16+g]);
} else if (i >= depth && dists[w*16+g] < euplims[w*16+g]) {
break;
}
/* !g is the DC band, it's important, since quantization error here
* applies to less than a cycle, it creates horrible intermodulation
* distortion if it doesn't stick to what psy requests
*/
if (!g && sce->ics.num_windows > 1 && dists[w*16+g] >= euplims[w*16+g])
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]);
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
float sqenergy;
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
scaled + w2*128,
sce->ics.swb_sizes[g],
sce->sf_idx[w*16+g]-1,
cb,
1.0f,
INFINITY,
&b, &sqenergy,
0);
bits += b;
qenergy += sqenergy;
}
sce->sf_idx[w*16+g]--;
dists[w*16+g] = dist - bits;
qenergies[w*16+g] = qenergy;
if (mb && (sce->sf_idx[w*16+g] < mindeltasf || (
(dists[w*16+g] < FFMIN(uplmax*uplims[w*16+g], euplims[w*16+g]))
&& (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g])
) )) {
break;
}
}
} else if (tbits > toofewbits && sce->sf_idx[w*16+g] < FFMIN(maxdeltasf, maxsf[w*16+g])
&& (dists[w*16+g] < FFMIN(euplims[w*16+g], uplims[w*16+g]))
&& (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g])
) {
/** Um... over target. Save bits for more important stuff. */
for (i = 0; i < depth && sce->sf_idx[w*16+g] < maxdeltasf; ++i) {
int cb, bits;
float dist, qenergy;
cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]+1);
if (cb > 0) {
dist = qenergy = 0.f;
bits = 0;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
float sqenergy;
dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128,
scaled + w2*128,
sce->ics.swb_sizes[g],
sce->sf_idx[w*16+g]+1,
cb,
1.0f,
INFINITY,
&b, &sqenergy,
0);
bits += b;
qenergy += sqenergy;
}
dist -= bits;
if (dist < FFMIN(euplims[w*16+g], uplims[w*16+g])) {
sce->sf_idx[w*16+g]++;
dists[w*16+g] = dist;
qenergies[w*16+g] = qenergy;
} else {
break;
}
} else {
maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]);
break;
}
}
}
prev = sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], mindeltasf, maxdeltasf);
if (sce->sf_idx[w*16+g] != prevsc)
fflag = 1;
nminscaler = FFMIN(nminscaler, sce->sf_idx[w*16+g]);
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
}
start += sce->ics.swb_sizes[g];
}
}
/** SF difference limit violation risk. Must re-clamp. */
prev = -1;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (!sce->zeroes[w*16+g]) {
int prevsf = sce->sf_idx[w*16+g];
if (prev < 0)
prev = prevsf;
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], prev - SCALE_MAX_DIFF, prev + SCALE_MAX_DIFF);
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
prev = sce->sf_idx[w*16+g];
if (!fflag && prevsf != sce->sf_idx[w*16+g])
fflag = 1;
}
}
}
its++;
} while (fflag && its < maxits);
/** Scout out next nonzero bands */
ff_init_nextband_map(sce, nextband);
prev = -1;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
/** Make sure proper codebooks are set */
for (g = 0; g < sce->ics.num_swb; g++) {
if (!sce->zeroes[w*16+g]) {
sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]);
if (sce->band_type[w*16+g] <= 0) {
if (!ff_sfdelta_can_remove_band(sce, nextband, prev, w*16+g)) {
/** Cannot zero out, make sure it's not attempted */
sce->band_type[w*16+g] = 1;
} else {
sce->zeroes[w*16+g] = 1;
sce->band_type[w*16+g] = 0;
}
}
} else {
sce->band_type[w*16+g] = 0;
}
/** Check that there's no SF delta range violations */
if (!sce->zeroes[w*16+g]) {
if (prev != -1) {
av_unused int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO;
av_assert1(sfdiff >= 0 && sfdiff <= 2*SCALE_MAX_DIFF);
} else if (sce->zeroes[0]) {
/** Set global gain to something useful */
sce->sf_idx[0] = sce->sf_idx[w*16+g];
}
prev = sce->sf_idx[w*16+g];
}
}
}
}
#endif /* AVCODEC_AACCODER_TWOLOOP_H */

View file

@ -0,0 +1,595 @@
/*
* AAC decoder
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
* Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
*
* AAC LATM decoder
* Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
* Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC decoder
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#define USE_FIXED 0
#include "libavutil/float_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "fft.h"
#include "mdct15.h"
#include "lpc.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aactab.h"
#include "aacdectab.h"
#include "adts_header.h"
#include "cbrt_data.h"
#include "sbr.h"
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "profiles.h"
#include "libavutil/intfloat.h"
#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <string.h>
#if ARCH_ARM
# include "arm/aac.h"
#elif ARCH_MIPS
# include "mips/aacdec_mips.h"
#endif
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
ps->r1 = 0.0f;
ps->cor0 = 0.0f;
ps->cor1 = 0.0f;
ps->var0 = 1.0f;
ps->var1 = 1.0f;
}
#ifndef VMUL2
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 15] * s;
*dst++ = v[idx>>4 & 15] * s;
return dst;
}
#endif
#ifndef VMUL4
static inline float *VMUL4(float *dst, const float *v, unsigned idx,
const float *scale)
{
float s = *scale;
*dst++ = v[idx & 3] * s;
*dst++ = v[idx>>2 & 3] * s;
*dst++ = v[idx>>4 & 3] * s;
*dst++ = v[idx>>6 & 3] * s;
return dst;
}
#endif
#ifndef VMUL2S
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
union av_intfloat32 s0, s1;
s0.f = s1.f = *scale;
s0.i ^= sign >> 1 << 31;
s1.i ^= sign << 31;
*dst++ = v[idx & 15] * s0.f;
*dst++ = v[idx>>4 & 15] * s1.f;
return dst;
}
#endif
#ifndef VMUL4S
static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
unsigned sign, const float *scale)
{
unsigned nz = idx >> 12;
union av_intfloat32 s = { .f = *scale };
union av_intfloat32 t;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>2 & 3] * t.f;
sign <<= nz & 1; nz >>= 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>4 & 3] * t.f;
sign <<= nz & 1;
t.i = s.i ^ (sign & 1U<<31);
*dst++ = v[idx>>6 & 3] * t.f;
return dst;
}
#endif
static av_always_inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_even(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
}
static av_always_inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
}
static av_always_inline void predict(PredictorState *ps, float *coef,
int output_enable)
{
const float a = 0.953125; // 61.0 / 64
const float alpha = 0.90625; // 29.0 / 32
float e0, e1;
float pv;
float k1, k2;
float r0 = ps->r0, r1 = ps->r1;
float cor0 = ps->cor0, cor1 = ps->cor1;
float var0 = ps->var0, var1 = ps->var1;
k1 = var0 > 1 ? cor0 * flt16_even(a / var0) : 0;
k2 = var1 > 1 ? cor1 * flt16_even(a / var1) : 0;
pv = flt16_round(k1 * r0 + k2 * r1);
if (output_enable)
*coef += pv;
e0 = *coef;
e1 = e0 - k1 * r0;
ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
ps->r0 = flt16_trunc(a * e0);
}
/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_dependent_coupling(AACContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
IndividualChannelStream *ics = &cce->ch[0].ics;
const uint16_t *offsets = ics->swb_offset;
float *dest = target->coeffs;
const float *src = cce->ch[0].coeffs;
int g, i, group, k, idx = 0;
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
av_log(ac->avctx, AV_LOG_ERROR,
"Dependent coupling is not supported together with LTP\n");
return;
}
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cce->ch[0].band_type[idx] != ZERO_BT) {
const float gain = cce->coup.gain[index][idx];
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
// FIXME: SIMDify
dest[group * 128 + k] += gain * src[group * 128 + k];
}
}
}
}
dest += ics->group_len[g] * 128;
src += ics->group_len[g] * 128;
}
}
/**
* Apply independent channel coupling (applied after IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_independent_coupling(AACContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
int i;
const float gain = cce->coup.gain[index][0];
const float *src = cce->ch[0].ret;
float *dest = target->ret;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
for (i = 0; i < len; i++)
dest[i] += gain * src[i];
}
#include "aacdec_template.c"
#define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word
struct LATMContext {
AACContext aac_ctx; ///< containing AACContext
int initialized; ///< initialized after a valid extradata was seen
// parser data
int audio_mux_version_A; ///< LATM syntax version
int frame_length_type; ///< 0/1 variable/fixed frame length
int frame_length; ///< frame length for fixed frame length
};
static inline uint32_t latm_get_value(GetBitContext *b)
{
int length = get_bits(b, 2);
return get_bits_long(b, (length+1)*8);
}
static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
GetBitContext *gb, int asclen)
{
AACContext *ac = &latmctx->aac_ctx;
AVCodecContext *avctx = ac->avctx;
MPEG4AudioConfig m4ac = { 0 };
GetBitContext gbc;
int config_start_bit = get_bits_count(gb);
int sync_extension = 0;
int bits_consumed, esize, i;
if (asclen > 0) {
sync_extension = 1;
asclen = FFMIN(asclen, get_bits_left(gb));
init_get_bits(&gbc, gb->buffer, config_start_bit + asclen);
skip_bits_long(&gbc, config_start_bit);
} else if (asclen == 0) {
gbc = *gb;
} else {
return AVERROR_INVALIDDATA;
}
if (get_bits_left(gb) <= 0)
return AVERROR_INVALIDDATA;
bits_consumed = decode_audio_specific_config_gb(NULL, avctx, &m4ac,
&gbc, config_start_bit,
sync_extension);
if (bits_consumed < config_start_bit)
return AVERROR_INVALIDDATA;
bits_consumed -= config_start_bit;
if (asclen == 0)
asclen = bits_consumed;
if (!latmctx->initialized ||
ac->oc[1].m4ac.sample_rate != m4ac.sample_rate ||
ac->oc[1].m4ac.chan_config != m4ac.chan_config) {
if (latmctx->initialized) {
av_log(avctx, AV_LOG_INFO, "audio config changed (sample_rate=%d, chan_config=%d)\n", m4ac.sample_rate, m4ac.chan_config);
} else {
av_log(avctx, AV_LOG_DEBUG, "initializing latmctx\n");
}
latmctx->initialized = 0;
esize = (asclen + 7) / 8;
if (avctx->extradata_size < esize) {
av_free(avctx->extradata);
avctx->extradata = av_malloc(esize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
}
avctx->extradata_size = esize;
gbc = *gb;
for (i = 0; i < esize; i++) {
avctx->extradata[i] = get_bits(&gbc, 8);
}
memset(avctx->extradata+esize, 0, AV_INPUT_BUFFER_PADDING_SIZE);
}
skip_bits_long(gb, asclen);
return 0;
}
static int read_stream_mux_config(struct LATMContext *latmctx,
GetBitContext *gb)
{
int ret, audio_mux_version = get_bits(gb, 1);
latmctx->audio_mux_version_A = 0;
if (audio_mux_version)
latmctx->audio_mux_version_A = get_bits(gb, 1);
if (!latmctx->audio_mux_version_A) {
if (audio_mux_version)
latm_get_value(gb); // taraFullness
skip_bits(gb, 1); // allStreamSameTimeFraming
skip_bits(gb, 6); // numSubFrames
// numPrograms
if (get_bits(gb, 4)) { // numPrograms
avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple programs");
return AVERROR_PATCHWELCOME;
}
// for each program (which there is only one in DVB)
// for each layer (which there is only one in DVB)
if (get_bits(gb, 3)) { // numLayer
avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple layers");
return AVERROR_PATCHWELCOME;
}
// for all but first stream: use_same_config = get_bits(gb, 1);
if (!audio_mux_version) {
if ((ret = latm_decode_audio_specific_config(latmctx, gb, 0)) < 0)
return ret;
} else {
int ascLen = latm_get_value(gb);
if ((ret = latm_decode_audio_specific_config(latmctx, gb, ascLen)) < 0)
return ret;
}
latmctx->frame_length_type = get_bits(gb, 3);
switch (latmctx->frame_length_type) {
case 0:
skip_bits(gb, 8); // latmBufferFullness
break;
case 1:
latmctx->frame_length = get_bits(gb, 9);
break;
case 3:
case 4:
case 5:
skip_bits(gb, 6); // CELP frame length table index
break;
case 6:
case 7:
skip_bits(gb, 1); // HVXC frame length table index
break;
}
if (get_bits(gb, 1)) { // other data
if (audio_mux_version) {
latm_get_value(gb); // other_data_bits
} else {
int esc;
do {
if (get_bits_left(gb) < 9)
return AVERROR_INVALIDDATA;
esc = get_bits(gb, 1);
skip_bits(gb, 8);
} while (esc);
}
}
if (get_bits(gb, 1)) // crc present
skip_bits(gb, 8); // config_crc
}
return 0;
}
static int read_payload_length_info(struct LATMContext *ctx, GetBitContext *gb)
{
uint8_t tmp;
if (ctx->frame_length_type == 0) {
int mux_slot_length = 0;
do {
if (get_bits_left(gb) < 8)
return AVERROR_INVALIDDATA;
tmp = get_bits(gb, 8);
mux_slot_length += tmp;
} while (tmp == 255);
return mux_slot_length;
} else if (ctx->frame_length_type == 1) {
return ctx->frame_length;
} else if (ctx->frame_length_type == 3 ||
ctx->frame_length_type == 5 ||
ctx->frame_length_type == 7) {
skip_bits(gb, 2); // mux_slot_length_coded
}
return 0;
}
static int read_audio_mux_element(struct LATMContext *latmctx,
GetBitContext *gb)
{
int err;
uint8_t use_same_mux = get_bits(gb, 1);
if (!use_same_mux) {
if ((err = read_stream_mux_config(latmctx, gb)) < 0)
return err;
} else if (!latmctx->aac_ctx.avctx->extradata) {
av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG,
"no decoder config found\n");
return 1;
}
if (latmctx->audio_mux_version_A == 0) {
int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);
if (mux_slot_length_bytes < 0 || mux_slot_length_bytes * 8LL > get_bits_left(gb)) {
av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");
return AVERROR_INVALIDDATA;
} else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {
av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,
"frame length mismatch %d << %d\n",
mux_slot_length_bytes * 8, get_bits_left(gb));
return AVERROR_INVALIDDATA;
}
}
return 0;
}
static int latm_decode_frame(AVCodecContext *avctx, void *out,
int *got_frame_ptr, AVPacket *avpkt)
{
struct LATMContext *latmctx = avctx->priv_data;
int muxlength, err;
GetBitContext gb;
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
return err;
// check for LOAS sync word
if (get_bits(&gb, 11) != LOAS_SYNC_WORD)
return AVERROR_INVALIDDATA;
muxlength = get_bits(&gb, 13) + 3;
// not enough data, the parser should have sorted this out
if (muxlength > avpkt->size)
return AVERROR_INVALIDDATA;
if ((err = read_audio_mux_element(latmctx, &gb)))
return (err < 0) ? err : avpkt->size;
if (!latmctx->initialized) {
if (!avctx->extradata) {
*got_frame_ptr = 0;
return avpkt->size;
} else {
push_output_configuration(&latmctx->aac_ctx);
if ((err = decode_audio_specific_config(
&latmctx->aac_ctx, avctx, &latmctx->aac_ctx.oc[1].m4ac,
avctx->extradata, avctx->extradata_size*8LL, 1)) < 0) {
pop_output_configuration(&latmctx->aac_ctx);
return err;
}
latmctx->initialized = 1;
}
}
if (show_bits(&gb, 12) == 0xfff) {
av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR,
"ADTS header detected, probably as result of configuration "
"misparsing\n");
return AVERROR_INVALIDDATA;
}
switch (latmctx->aac_ctx.oc[1].m4ac.object_type) {
case AOT_ER_AAC_LC:
case AOT_ER_AAC_LTP:
case AOT_ER_AAC_LD:
case AOT_ER_AAC_ELD:
err = aac_decode_er_frame(avctx, out, got_frame_ptr, &gb);
break;
default:
err = aac_decode_frame_int(avctx, out, got_frame_ptr, &gb, avpkt);
}
if (err < 0)
return err;
return muxlength;
}
static av_cold int latm_decode_init(AVCodecContext *avctx)
{
struct LATMContext *latmctx = avctx->priv_data;
int ret = aac_decode_init(avctx);
if (avctx->extradata_size > 0)
latmctx->initialized = !ret;
return ret;
}
AVCodec ff_aac_decoder = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
.decode = aac_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
/*
Note: This decoder filter is intended to decode LATM streams transferred
in MPEG transport streams which only contain one program.
To do a more complex LATM demuxing a separate LATM demuxer should be used.
*/
AVCodec ff_aac_latm_decoder = {
.name = "aac_latm",
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC_LATM,
.priv_data_size = sizeof(struct LATMContext),
.init = latm_decode_init,
.close = aac_decode_close,
.decode = latm_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.channel_layouts = aac_channel_layout,
.flush = flush,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};

View file

@ -0,0 +1,468 @@
/*
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* AAC decoder fixed-point implementation
*
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC decoder
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*
* Fixed point implementation
* @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#define USE_FIXED 1
#include "libavutil/fixed_dsp.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
#include "fft.h"
#include "lpc.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aactab.h"
#include "aacdectab.h"
#include "adts_header.h"
#include "cbrt_data.h"
#include "sbr.h"
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "profiles.h"
#include "libavutil/intfloat.h"
#include <math.h>
#include <string.h>
static av_always_inline void reset_predict_state(PredictorState *ps)
{
ps->r0.mant = 0;
ps->r0.exp = 0;
ps->r1.mant = 0;
ps->r1.exp = 0;
ps->cor0.mant = 0;
ps->cor0.exp = 0;
ps->cor1.mant = 0;
ps->cor1.exp = 0;
ps->var0.mant = 0x20000000;
ps->var0.exp = 1;
ps->var1.mant = 0x20000000;
ps->var1.exp = 1;
}
static const int exp2tab[4] = { Q31(1.0000000000/2), Q31(1.1892071150/2), Q31(1.4142135624/2), Q31(1.6817928305/2) }; // 2^0, 2^0.25, 2^0.5, 2^0.75
static inline int *DEC_SPAIR(int *dst, unsigned idx)
{
dst[0] = (idx & 15) - 4;
dst[1] = (idx >> 4 & 15) - 4;
return dst + 2;
}
static inline int *DEC_SQUAD(int *dst, unsigned idx)
{
dst[0] = (idx & 3) - 1;
dst[1] = (idx >> 2 & 3) - 1;
dst[2] = (idx >> 4 & 3) - 1;
dst[3] = (idx >> 6 & 3) - 1;
return dst + 4;
}
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
{
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) * 2));
return dst + 2;
}
static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
{
unsigned nz = idx >> 12;
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) * 2));
sign <<= nz & 1;
nz >>= 1;
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) * 2));
return dst + 4;
}
static void vector_pow43(int *coefs, int len)
{
int i, coef;
for (i=0; i<len; i++) {
coef = coefs[i];
if (coef < 0)
coef = -(int)ff_cbrt_tab_fixed[-coef];
else
coef = (int)ff_cbrt_tab_fixed[coef];
coefs[i] = coef;
}
}
static void subband_scale(int *dst, int *src, int scale, int offset, int len)
{
int ssign = scale < 0 ? -1 : 1;
int s = FFABS(scale);
unsigned int round;
int i, out, c = exp2tab[s & 3];
s = offset - (s >> 2);
if (s > 31) {
for (i=0; i<len; i++) {
dst[i] = 0;
}
} else if (s > 0) {
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)(((int64_t)src[i] * c) >> 32);
dst[i] = ((int)(out+round) >> s) * ssign;
}
} else if (s > -32) {
s = s + 32;
round = 1U << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);
dst[i] = out * (unsigned)ssign;
}
} else {
av_log(NULL, AV_LOG_ERROR, "Overflow in subband_scale()\n");
}
}
static void noise_scale(int *coefs, int scale, int band_energy, int len)
{
int s = -scale;
unsigned int round;
int i, out, c = exp2tab[s & 3];
int nlz = 0;
av_assert0(s >= 0);
while (band_energy > 0x7fff) {
band_energy >>= 1;
nlz++;
}
c /= band_energy;
s = 21 + nlz - (s >> 2);
if (s > 31) {
for (i=0; i<len; i++) {
coefs[i] = 0;
}
} else if (s >= 0) {
round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32);
coefs[i] = -((int)(out+round) >> s);
}
}
else {
s = s + 32;
if (s > 0) {
round = 1 << (s-1);
for (i=0; i<len; i++) {
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
coefs[i] = -out;
}
} else {
for (i=0; i<len; i++)
coefs[i] = -(int64_t)coefs[i] * c * (1 << -s);
}
}
}
static av_always_inline SoftFloat flt16_round(SoftFloat pf)
{
SoftFloat tmp;
int s;
tmp.exp = pf.exp;
s = pf.mant >> 31;
tmp.mant = (pf.mant ^ s) - s;
tmp.mant = (tmp.mant + 0x00200000U) & 0xFFC00000U;
tmp.mant = (tmp.mant ^ s) - s;
return tmp;
}
static av_always_inline SoftFloat flt16_even(SoftFloat pf)
{
SoftFloat tmp;
int s;
tmp.exp = pf.exp;
s = pf.mant >> 31;
tmp.mant = (pf.mant ^ s) - s;
tmp.mant = (tmp.mant + 0x001FFFFFU + (tmp.mant & 0x00400000U >> 16)) & 0xFFC00000U;
tmp.mant = (tmp.mant ^ s) - s;
return tmp;
}
static av_always_inline SoftFloat flt16_trunc(SoftFloat pf)
{
SoftFloat pun;
int s;
pun.exp = pf.exp;
s = pf.mant >> 31;
pun.mant = (pf.mant ^ s) - s;
pun.mant = pun.mant & 0xFFC00000U;
pun.mant = (pun.mant ^ s) - s;
return pun;
}
static av_always_inline void predict(PredictorState *ps, int *coef,
int output_enable)
{
const SoftFloat a = { 1023410176, 0 }; // 61.0 / 64
const SoftFloat alpha = { 973078528, 0 }; // 29.0 / 32
SoftFloat e0, e1;
SoftFloat pv;
SoftFloat k1, k2;
SoftFloat r0 = ps->r0, r1 = ps->r1;
SoftFloat cor0 = ps->cor0, cor1 = ps->cor1;
SoftFloat var0 = ps->var0, var1 = ps->var1;
SoftFloat tmp;
if (var0.exp > 1 || (var0.exp == 1 && var0.mant > 0x20000000)) {
k1 = av_mul_sf(cor0, flt16_even(av_div_sf(a, var0)));
}
else {
k1.mant = 0;
k1.exp = 0;
}
if (var1.exp > 1 || (var1.exp == 1 && var1.mant > 0x20000000)) {
k2 = av_mul_sf(cor1, flt16_even(av_div_sf(a, var1)));
}
else {
k2.mant = 0;
k2.exp = 0;
}
tmp = av_mul_sf(k1, r0);
pv = flt16_round(av_add_sf(tmp, av_mul_sf(k2, r1)));
if (output_enable) {
int shift = 28 - pv.exp;
if (shift < 31) {
if (shift > 0) {
*coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
} else
*coef += (unsigned)pv.mant << -shift;
}
}
e0 = av_int2sf(*coef, 2);
e1 = av_sub_sf(e0, tmp);
ps->cor1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor1), av_mul_sf(r1, e1)));
tmp = av_add_sf(av_mul_sf(r1, r1), av_mul_sf(e1, e1));
tmp.exp--;
ps->var1 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var1), tmp));
ps->cor0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, cor0), av_mul_sf(r0, e0)));
tmp = av_add_sf(av_mul_sf(r0, r0), av_mul_sf(e0, e0));
tmp.exp--;
ps->var0 = flt16_trunc(av_add_sf(av_mul_sf(alpha, var0), tmp));
ps->r1 = flt16_trunc(av_mul_sf(a, av_sub_sf(r0, av_mul_sf(k1, e0))));
ps->r0 = flt16_trunc(av_mul_sf(a, e0));
}
static const int cce_scale_fixed[8] = {
Q30(1.0), //2^(0/8)
Q30(1.0905077327), //2^(1/8)
Q30(1.1892071150), //2^(2/8)
Q30(1.2968395547), //2^(3/8)
Q30(1.4142135624), //2^(4/8)
Q30(1.5422108254), //2^(5/8)
Q30(1.6817928305), //2^(6/8)
Q30(1.8340080864), //2^(7/8)
};
/**
* Apply dependent channel coupling (applied before IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_dependent_coupling_fixed(AACContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
IndividualChannelStream *ics = &cce->ch[0].ics;
const uint16_t *offsets = ics->swb_offset;
int *dest = target->coeffs;
const int *src = cce->ch[0].coeffs;
int g, i, group, k, idx = 0;
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
av_log(ac->avctx, AV_LOG_ERROR,
"Dependent coupling is not supported together with LTP\n");
return;
}
for (g = 0; g < ics->num_window_groups; g++) {
for (i = 0; i < ics->max_sfb; i++, idx++) {
if (cce->ch[0].band_type[idx] != ZERO_BT) {
const int gain = cce->coup.gain[index][idx];
int shift, round, c, tmp;
if (gain < 0) {
c = -cce_scale_fixed[-gain & 7];
shift = (-gain-1024) >> 3;
}
else {
c = cce_scale_fixed[gain & 7];
shift = (gain-1024) >> 3;
}
if (shift < -31) {
// Nothing to do
} else if (shift < 0) {
shift = -shift;
round = 1 << (shift - 1);
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
(int64_t)0x1000000000) >> 37);
dest[group * 128 + k] += (tmp + (int64_t)round) >> shift;
}
}
}
else {
for (group = 0; group < ics->group_len[g]; group++) {
for (k = offsets[i]; k < offsets[i + 1]; k++) {
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
(int64_t)0x1000000000) >> 37);
dest[group * 128 + k] += tmp * (1U << shift);
}
}
}
}
}
dest += ics->group_len[g] * 128;
src += ics->group_len[g] * 128;
}
}
/**
* Apply independent channel coupling (applied after IMDCT).
*
* @param index index into coupling gain array
*/
static void apply_independent_coupling_fixed(AACContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
int i, c, shift, round, tmp;
const int gain = cce->coup.gain[index][0];
const int *src = cce->ch[0].ret;
unsigned int *dest = target->ret;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
c = cce_scale_fixed[gain & 7];
shift = (gain-1024) >> 3;
if (shift < -31) {
return;
} else if (shift < 0) {
shift = -shift;
round = 1 << (shift - 1);
for (i = 0; i < len; i++) {
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
dest[i] += (tmp + round) >> shift;
}
}
else {
for (i = 0; i < len; i++) {
tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
dest[i] += tmp * (1U << shift);
}
}
}
#include "aacdec_template.c"
AVCodec ff_aac_fixed_decoder = {
.name = "aac_fixed",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
.decode = aac_decode_frame,
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE
},
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = aac_channel_layout,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.flush = flush,
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,74 @@
/*
* AAC decoder data
* Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
* Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC decoder data
* @author Oded Shimon ( ods15 ods15 dyndns org )
* @author Maxim Gavrilov ( maxim.gavrilov gmail com )
*/
#ifndef AVCODEC_AACDECTAB_H
#define AVCODEC_AACDECTAB_H
#include "libavutil/channel_layout.h"
#include "aac.h"
#include <stdint.h>
static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 4, 5, 0, 5, 0 };
static const uint8_t aac_channel_layout_map[16][5][3] = {
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, },
{ { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
{ { 0, } },
{ { 0, } },
{ { 0, } },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
{ { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_SIDE }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, },
{ { 0, } },
/* TODO: Add 7+1 TOP configuration */
};
static const uint64_t aac_channel_layout[16] = {
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_SURROUND,
AV_CH_LAYOUT_4POINT0,
AV_CH_LAYOUT_5POINT0_BACK,
AV_CH_LAYOUT_5POINT1_BACK,
AV_CH_LAYOUT_7POINT1_WIDE_BACK,
0,
0,
0,
AV_CH_LAYOUT_6POINT1,
AV_CH_LAYOUT_7POINT1,
0,
/* AV_CH_LAYOUT_7POINT1_TOP, */
};
#endif /* AVCODEC_AACDECTAB_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,428 @@
/*
* AAC encoder
* Copyright (C) 2008 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACENC_H
#define AVCODEC_AACENC_H
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "audio_frame_queue.h"
#include "psymodel.h"
#include "lpc.h"
typedef enum AACCoder {
AAC_CODER_ANMR = 0,
AAC_CODER_TWOLOOP,
AAC_CODER_FAST,
AAC_CODER_NB,
}AACCoder;
typedef struct AACEncOptions {
int coder;
int pns;
int tns;
int ltp;
int pce;
int pred;
int mid_side;
int intensity_stereo;
} AACEncOptions;
struct AACEncContext;
typedef struct AACCoefficientsEncoder {
void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
SingleChannelElement *sce, const float lambda);
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda);
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size,
int scale_idx, int cb, const float lambda, int rtz);
void (*encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce);
void (*encode_ltp_info)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
void (*encode_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
void (*adjust_common_pred)(struct AACEncContext *s, ChannelElement *cpe);
void (*adjust_common_ltp)(struct AACEncContext *s, ChannelElement *cpe);
void (*apply_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
void (*apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce);
void (*update_ltp)(struct AACEncContext *s, SingleChannelElement *sce);
void (*ltp_insert_new_frame)(struct AACEncContext *s);
void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
void (*mark_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
void (*search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce);
void (*search_for_ltp)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe);
void (*search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
void (*search_for_pred)(struct AACEncContext *s, SingleChannelElement *sce);
} AACCoefficientsEncoder;
extern const AACCoefficientsEncoder ff_aac_coders[];
typedef struct AACQuantizeBandCostCacheEntry {
float rd;
float energy;
int bits;
char cb;
char rtz;
uint16_t generation;
} AACQuantizeBandCostCacheEntry;
typedef struct AACPCEInfo {
int64_t layout;
int num_ele[4]; ///< front, side, back, lfe
int pairing[3][8]; ///< front, side, back
int index[4][8]; ///< front, side, back, lfe
uint8_t config_map[16]; ///< configs the encoder's channel specific settings
uint8_t reorder_map[16]; ///< maps channels from lavc to aac order
} AACPCEInfo;
/**
* List of PCE (Program Configuration Element) for the channel layouts listed
* in channel_layout.h
*
* For those wishing in the future to add other layouts:
*
* - num_ele: number of elements in each group of front, side, back, lfe channels
* (an element is of type SCE (single channel), CPE (channel pair) for
* the first 3 groups; and is LFE for LFE group).
*
* - pairing: 0 for an SCE element or 1 for a CPE; does not apply to LFE group
*
* - index: there are three independent indices for SCE, CPE and LFE;
* they are incremented irrespective of the group to which the element belongs;
* they are not reset when going from one group to another
*
* Example: for 7.0 channel layout,
* .pairing = { { 1, 0 }, { 1 }, { 1 }, }, (3 CPE and 1 SCE in front group)
* .index = { { 0, 0 }, { 1 }, { 2 }, },
* (index is 0 for the single SCE but goes from 0 to 2 for the CPEs)
*
* The index order impacts the channel ordering. But is otherwise arbitrary
* (the sequence could have been 2, 0, 1 instead of 0, 1, 2).
*
* Spec allows for discontinuous indices, e.g. if one has a total of two SCE,
* SCE.0 SCE.15 is OK per spec; BUT it won't be decoded by our AAC decoder
* which at this time requires that indices fully cover some range starting
* from 0 (SCE.1 SCE.0 is OK but not SCE.0 SCE.15).
*
* - config_map: total number of elements and their types. Beware, the way the
* types are ordered impacts the final channel ordering.
*
* - reorder_map: reorders the channels.
*
*/
static const AACPCEInfo aac_pce_configs[] = {
{
.layout = AV_CH_LAYOUT_MONO,
.num_ele = { 1, 0, 0, 0 },
.pairing = { { 0 }, },
.index = { { 0 }, },
.config_map = { 1, TYPE_SCE, },
.reorder_map = { 0 },
},
{
.layout = AV_CH_LAYOUT_STEREO,
.num_ele = { 1, 0, 0, 0 },
.pairing = { { 1 }, },
.index = { { 0 }, },
.config_map = { 1, TYPE_CPE, },
.reorder_map = { 0, 1 },
},
{
.layout = AV_CH_LAYOUT_2POINT1,
.num_ele = { 1, 0, 0, 1 },
.pairing = { { 1 }, },
.index = { { 0 },{ 0 },{ 0 },{ 0 } },
.config_map = { 2, TYPE_CPE, TYPE_LFE },
.reorder_map = { 0, 1, 2 },
},
{
.layout = AV_CH_LAYOUT_2_1,
.num_ele = { 1, 0, 1, 0 },
.pairing = { { 1 },{ 0 },{ 0 } },
.index = { { 0 },{ 0 },{ 0 }, },
.config_map = { 2, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2 },
},
{
.layout = AV_CH_LAYOUT_SURROUND,
.num_ele = { 2, 0, 0, 0 },
.pairing = { { 1, 0 }, },
.index = { { 0, 0 }, },
.config_map = { 2, TYPE_CPE, TYPE_SCE, },
.reorder_map = { 0, 1, 2 },
},
{
.layout = AV_CH_LAYOUT_3POINT1,
.num_ele = { 2, 0, 0, 1 },
.pairing = { { 1, 0 }, },
.index = { { 0, 0 }, { 0 }, { 0 }, { 0 }, },
.config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_LFE },
.reorder_map = { 0, 1, 2, 3 },
},
{
.layout = AV_CH_LAYOUT_4POINT0,
.num_ele = { 2, 0, 1, 0 },
.pairing = { { 1, 0 }, { 0 }, { 0 }, },
.index = { { 0, 0 }, { 0 }, { 1 } },
.config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3 },
},
{
.layout = AV_CH_LAYOUT_4POINT1,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 0 }, { 0 }, },
.index = { { 0, 0 }, { 1 }, { 2 }, { 0 } },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4 },
},
{
.layout = AV_CH_LAYOUT_2_2,
.num_ele = { 1, 1, 0, 0 },
.pairing = { { 1 }, { 1 }, },
.index = { { 0 }, { 1 }, },
.config_map = { 2, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3 },
},
{
.layout = AV_CH_LAYOUT_QUAD,
.num_ele = { 1, 0, 1, 0 },
.pairing = { { 1 }, { 0 }, { 1 }, },
.index = { { 0 }, { 0 }, { 1 } },
.config_map = { 2, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3 },
},
{
.layout = AV_CH_LAYOUT_5POINT0,
.num_ele = { 2, 1, 0, 0 },
.pairing = { { 1, 0 }, { 1 }, },
.index = { { 0, 0 }, { 1 } },
.config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4 },
},
{
.layout = AV_CH_LAYOUT_5POINT1,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1 }, },
.index = { { 0, 0 }, { 1 }, { 1 } },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5 },
},
{
.layout = AV_CH_LAYOUT_5POINT0_BACK,
.num_ele = { 2, 0, 1, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1 } },
.index = { { 0, 0 }, { 0 }, { 1 } },
.config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4 },
},
{
.layout = AV_CH_LAYOUT_5POINT1_BACK,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1 }, },
.index = { { 0, 0 }, { 1 }, { 1 } },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5 },
},
{
.layout = AV_CH_LAYOUT_6POINT0,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 1 }, { 0 }, },
.index = { { 0, 0 }, { 1 }, { 1 } },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5 },
},
{
.layout = AV_CH_LAYOUT_6POINT0_FRONT,
.num_ele = { 2, 1, 0, 0 },
.pairing = { { 1, 1 }, { 1 } },
.index = { { 1, 0 }, { 2 }, },
.config_map = { 3, TYPE_CPE, TYPE_CPE, TYPE_CPE, },
.reorder_map = { 0, 1, 2, 3, 4, 5 },
},
{
.layout = AV_CH_LAYOUT_HEXAGONAL,
.num_ele = { 2, 0, 2, 0 },
.pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
.index = { { 0, 0 },{ 0 },{ 1, 1 } },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, },
.reorder_map = { 0, 1, 2, 3, 4, 5 },
},
{
.layout = AV_CH_LAYOUT_6POINT1,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
.index = { { 0, 0 },{ 1 },{ 1, 2 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
},
{
.layout = AV_CH_LAYOUT_6POINT1_BACK,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
.index = { { 0, 0 }, { 1 }, { 1, 2 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
},
{
.layout = AV_CH_LAYOUT_6POINT1_FRONT,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
.index = { { 0, 0 }, { 1 }, { 1, 2 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
},
{
.layout = AV_CH_LAYOUT_7POINT0,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 1 }, { 1 }, },
.index = { { 0, 0 }, { 1 }, { 2 }, },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
},
{
.layout = AV_CH_LAYOUT_7POINT0_FRONT,
.num_ele = { 2, 1, 1, 0 },
.pairing = { { 1, 0 }, { 1 }, { 1 }, },
.index = { { 0, 0 }, { 1 }, { 2 }, },
.config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
},
{
.layout = AV_CH_LAYOUT_7POINT1,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
.index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
},
{
.layout = AV_CH_LAYOUT_7POINT1_WIDE,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 0 },{ 1, 1 }, },
.index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
},
{
.layout = AV_CH_LAYOUT_7POINT1_WIDE_BACK,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
.index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
},
{
.layout = AV_CH_LAYOUT_OCTAGONAL,
.num_ele = { 2, 1, 2, 0 },
.pairing = { { 1, 0 }, { 1 }, { 1, 0 }, },
.index = { { 0, 0 }, { 1 }, { 2, 1 } },
.config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
},
{ /* Meant for order 2/mixed ambisonics */
.layout = AV_CH_LAYOUT_OCTAGONAL | AV_CH_TOP_CENTER,
.num_ele = { 2, 2, 2, 0 },
.pairing = { { 1, 0 }, { 1, 0 }, { 1, 0 }, },
.index = { { 0, 0 }, { 1, 1 }, { 2, 2 } },
.config_map = { 6, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
},
{ /* Meant for order 2/mixed ambisonics */
.layout = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_BACK_CENTER |
AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_TOP_CENTER,
.num_ele = { 2, 2, 2, 0 },
.pairing = { { 1, 1 }, { 1, 0 }, { 1, 0 }, },
.index = { { 0, 1 }, { 2, 0 }, { 3, 1 } },
.config_map = { 6, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
},
{
.layout = AV_CH_LAYOUT_HEXADECAGONAL,
.num_ele = { 4, 2, 4, 0 },
.pairing = { { 1, 0, 1, 0 }, { 1, 1 }, { 1, 0, 1, 0 }, },
.index = { { 0, 0, 1, 1 }, { 2, 3 }, { 4, 2, 5, 3 } },
.config_map = { 10, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
.reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
},
};
/**
* AAC encoder context
*/
typedef struct AACEncContext {
AVClass *av_class;
AACEncOptions options; ///< encoding options
PutBitContext pb;
FFTContext mdct1024; ///< long (1024 samples) frame transform context
FFTContext mdct128; ///< short (128 samples) frame transform context
AVFloatDSPContext *fdsp;
AACPCEInfo pce; ///< PCE data, if needed
float *planar_samples[16]; ///< saved preprocessed input
int profile; ///< copied from avctx
int needs_pce; ///< flag for non-standard layout
LPCContext lpc; ///< used by TNS
int samplerate_index; ///< MPEG-4 samplerate index
int channels; ///< channel count
const uint8_t *reorder_map; ///< lavc to aac reorder map
const uint8_t *chan_map; ///< channel configuration map
ChannelElement *cpe; ///< channel elements
FFPsyContext psy;
struct FFPsyPreprocessContext* psypp;
const AACCoefficientsEncoder *coder;
int cur_channel; ///< current channel for coder context
int random_state;
float lambda;
int last_frame_pb_count; ///< number of bits for the previous frame
float lambda_sum; ///< sum(lambda), for Qvg reporting
int lambda_count; ///< count(lambda), for Qvg reporting
enum RawDataBlockType cur_type; ///< channel group type cur_channel belongs to
AudioFrameQueue afq;
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
uint16_t quantize_band_cost_cache_generation;
AACQuantizeBandCostCacheEntry quantize_band_cost_cache[256][128]; ///< memoization area for quantize_band_cost
void (*abs_pow34)(float *out, const float *in, const int size);
void (*quant_bands)(int *out, const float *in, const float *scaled,
int size, int is_signed, int maxval, const float Q34,
const float rounding);
struct {
float *samples;
} buffer;
} AACEncContext;
void ff_aac_dsp_init_x86(AACEncContext *s);
void ff_aac_coder_init_mips(AACEncContext *c);
void ff_quantize_band_cost_cache_init(struct AACEncContext *s);
#endif /* AVCODEC_AACENC_H */

View file

@ -0,0 +1,158 @@
/*
* AAC encoder intensity stereo
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder Intensity Stereo
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#include "aacenc.h"
#include "aacenc_utils.h"
#include "aacenc_is.h"
#include "aacenc_quantization.h"
struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
int start, int w, int g, float ener0,
float ener1, float ener01,
int use_pcoeffs, int phase)
{
int i, w2;
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
float *L = use_pcoeffs ? sce0->pcoeffs : sce0->coeffs;
float *R = use_pcoeffs ? sce1->pcoeffs : sce1->coeffs;
float *L34 = &s->scoefs[256*0], *R34 = &s->scoefs[256*1];
float *IS = &s->scoefs[256*2], *I34 = &s->scoefs[256*3];
float dist1 = 0.0f, dist2 = 0.0f;
struct AACISError is_error = {0};
if (ener01 <= 0 || ener0 <= 0) {
is_error.pass = 0;
return is_error;
}
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
int is_band_type, is_sf_idx = FFMAX(1, sce0->sf_idx[w*16+g]-4);
float e01_34 = phase*pos_pow34(ener1/ener0);
float maxval, dist_spec_err = 0.0f;
float minthr = FFMIN(band0->threshold, band1->threshold);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++)
IS[i] = (L[start+(w+w2)*128+i] + phase*R[start+(w+w2)*128+i])*sqrt(ener0/ener01);
s->abs_pow34(L34, &L[start+(w+w2)*128], sce0->ics.swb_sizes[g]);
s->abs_pow34(R34, &R[start+(w+w2)*128], sce0->ics.swb_sizes[g]);
s->abs_pow34(I34, IS, sce0->ics.swb_sizes[g]);
maxval = find_max_val(1, sce0->ics.swb_sizes[g], I34);
is_band_type = find_min_book(maxval, is_sf_idx);
dist1 += quantize_band_cost(s, &L[start + (w+w2)*128], L34,
sce0->ics.swb_sizes[g],
sce0->sf_idx[w*16+g],
sce0->band_type[w*16+g],
s->lambda / band0->threshold, INFINITY, NULL, NULL, 0);
dist1 += quantize_band_cost(s, &R[start + (w+w2)*128], R34,
sce1->ics.swb_sizes[g],
sce1->sf_idx[w*16+g],
sce1->band_type[w*16+g],
s->lambda / band1->threshold, INFINITY, NULL, NULL, 0);
dist2 += quantize_band_cost(s, IS, I34, sce0->ics.swb_sizes[g],
is_sf_idx, is_band_type,
s->lambda / minthr, INFINITY, NULL, NULL, 0);
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
dist_spec_err += (L34[i] - I34[i])*(L34[i] - I34[i]);
dist_spec_err += (R34[i] - I34[i]*e01_34)*(R34[i] - I34[i]*e01_34);
}
dist_spec_err *= s->lambda / minthr;
dist2 += dist_spec_err;
}
is_error.pass = dist2 <= dist1;
is_error.phase = phase;
is_error.error = dist2 - dist1;
is_error.dist1 = dist1;
is_error.dist2 = dist2;
is_error.ener01 = ener01;
return is_error;
}
void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe)
{
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
int start = 0, count = 0, w, w2, g, i, prev_sf1 = -1, prev_bt = -1, prev_is = 0;
const float freq_mult = avctx->sample_rate/(1024.0f/sce0->ics.num_windows)/2.0f;
uint8_t nextband1[128];
if (!cpe->common_window)
return;
/** Scout out next nonzero bands */
ff_init_nextband_map(sce1, nextband1);
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce0->ics.num_swb; g++) {
if (start*freq_mult > INT_STEREO_LOW_LIMIT*(s->lambda/170.0f) &&
cpe->ch[0].band_type[w*16+g] != NOISE_BT && !cpe->ch[0].zeroes[w*16+g] &&
cpe->ch[1].band_type[w*16+g] != NOISE_BT && !cpe->ch[1].zeroes[w*16+g] &&
ff_sfdelta_can_remove_band(sce1, nextband1, prev_sf1, w*16+g)) {
float ener0 = 0.0f, ener1 = 0.0f, ener01 = 0.0f, ener01p = 0.0f;
struct AACISError ph_err1, ph_err2, *best;
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
float coef0 = sce0->coeffs[start+(w+w2)*128+i];
float coef1 = sce1->coeffs[start+(w+w2)*128+i];
ener0 += coef0*coef0;
ener1 += coef1*coef1;
ener01 += (coef0 + coef1)*(coef0 + coef1);
ener01p += (coef0 - coef1)*(coef0 - coef1);
}
}
ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
ener0, ener1, ener01p, 0, -1);
ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
ener0, ener1, ener01, 0, +1);
best = (ph_err1.pass && ph_err1.error < ph_err2.error) ? &ph_err1 : &ph_err2;
if (best->pass) {
cpe->is_mask[w*16+g] = 1;
cpe->ms_mask[w*16+g] = 0;
cpe->ch[0].is_ener[w*16+g] = sqrt(ener0 / best->ener01);
cpe->ch[1].is_ener[w*16+g] = ener0/ener1;
cpe->ch[1].band_type[w*16+g] = (best->phase > 0) ? INTENSITY_BT : INTENSITY_BT2;
if (prev_is && prev_bt != cpe->ch[1].band_type[w*16+g]) {
/** Flip M/S mask and pick the other CB, since it encodes more efficiently */
cpe->ms_mask[w*16+g] = 1;
cpe->ch[1].band_type[w*16+g] = (best->phase > 0) ? INTENSITY_BT2 : INTENSITY_BT;
}
prev_bt = cpe->ch[1].band_type[w*16+g];
count++;
}
}
if (!sce1->zeroes[w*16+g] && sce1->band_type[w*16+g] < RESERVED_BT)
prev_sf1 = sce1->sf_idx[w*16+g];
prev_is = cpe->is_mask[w*16+g];
start += sce0->ics.swb_sizes[g];
}
}
cpe->is_mode = !!count;
}

View file

@ -0,0 +1,51 @@
/*
* AAC encoder intensity stereo
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder Intensity Stereo
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_IS_H
#define AVCODEC_AACENC_IS_H
#include "aacenc.h"
/** Frequency in Hz for lower limit of intensity stereo **/
#define INT_STEREO_LOW_LIMIT 6100
struct AACISError {
int pass; /* 1 if dist2 <= dist1 */
int phase; /* -1 or +1 */
float error; /* fabs(dist1 - dist2) */
float dist1; /* From original coeffs */
float dist2; /* From IS'd coeffs */
float ener01;
};
struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
int start, int w, int g, float ener0,
float ener1, float ener01,
int use_pcoeffs, int phase);
void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
#endif /* AVCODEC_AACENC_IS_H */

View file

@ -0,0 +1,236 @@
/*
* AAC encoder long term prediction extension
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder long term prediction extension
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#include "aacenc_ltp.h"
#include "aacenc_quantization.h"
#include "aacenc_utils.h"
/**
* Encode LTP data.
*/
void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce,
int common_window)
{
int i;
IndividualChannelStream *ics = &sce->ics;
if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present)
return;
if (common_window)
put_bits(&s->pb, 1, 0);
put_bits(&s->pb, 1, ics->ltp.present);
if (!ics->ltp.present)
return;
put_bits(&s->pb, 11, ics->ltp.lag);
put_bits(&s->pb, 3, ics->ltp.coef_idx);
for (i = 0; i < FFMIN(ics->max_sfb, MAX_LTP_LONG_SFB); i++)
put_bits(&s->pb, 1, ics->ltp.used[i]);
}
void ff_aac_ltp_insert_new_frame(AACEncContext *s)
{
int i, ch, tag, chans, cur_channel, start_ch = 0;
ChannelElement *cpe;
SingleChannelElement *sce;
for (i = 0; i < s->chan_map[0]; i++) {
cpe = &s->cpe[i];
tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
for (ch = 0; ch < chans; ch++) {
sce = &cpe->ch[ch];
cur_channel = start_ch + ch;
/* New sample + overlap */
memcpy(&sce->ltp_state[0], &sce->ltp_state[1024], 1024*sizeof(sce->ltp_state[0]));
memcpy(&sce->ltp_state[1024], &s->planar_samples[cur_channel][2048], 1024*sizeof(sce->ltp_state[0]));
memcpy(&sce->ltp_state[2048], &sce->ret_buf[0], 1024*sizeof(sce->ltp_state[0]));
sce->ics.ltp.lag = 0;
}
start_ch += chans;
}
}
static void get_lag(float *buf, const float *new, LongTermPrediction *ltp)
{
int i, j, lag = 0, max_corr = 0;
float max_ratio = 0.0f;
for (i = 0; i < 2048; i++) {
float corr, s0 = 0.0f, s1 = 0.0f;
const int start = FFMAX(0, i - 1024);
for (j = start; j < 2048; j++) {
const int idx = j - i + 1024;
s0 += new[j]*buf[idx];
s1 += buf[idx]*buf[idx];
}
corr = s1 > 0.0f ? s0/sqrt(s1) : 0.0f;
if (corr > max_corr) {
max_corr = corr;
lag = i;
max_ratio = corr/(2048-start);
}
}
ltp->lag = FFMAX(av_clip_uintp2(lag, 11), 0);
ltp->coef_idx = quant_array_idx(max_ratio, ltp_coef, 8);
ltp->coef = ltp_coef[ltp->coef_idx];
}
static void generate_samples(float *buf, LongTermPrediction *ltp)
{
int i, samples_num = 2048;
if (!ltp->lag) {
ltp->present = 0;
return;
} else if (ltp->lag < 1024) {
samples_num = ltp->lag + 1024;
}
for (i = 0; i < samples_num; i++)
buf[i] = ltp->coef*buf[i + 2048 - ltp->lag];
memset(&buf[i], 0, (2048 - i)*sizeof(float));
}
/**
* Process LTP parameters
* @see Patent WO2006070265A1
*/
void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce)
{
float *pred_signal = &sce->ltp_state[0];
const float *samples = &s->planar_samples[s->cur_channel][1024];
if (s->profile != FF_PROFILE_AAC_LTP)
return;
/* Calculate lag */
get_lag(pred_signal, samples, &sce->ics.ltp);
generate_samples(pred_signal, &sce->ics.ltp);
}
void ff_aac_adjust_common_ltp(AACEncContext *s, ChannelElement *cpe)
{
int sfb, count = 0;
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
if (!cpe->common_window ||
sce0->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE ||
sce1->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
sce0->ics.ltp.present = 0;
return;
}
for (sfb = 0; sfb < FFMIN(sce0->ics.max_sfb, MAX_LTP_LONG_SFB); sfb++) {
int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb];
if (sum != 2) {
sce0->ics.ltp.used[sfb] = 0;
} else if (sum == 2) {
count++;
}
}
sce0->ics.ltp.present = !!count;
sce0->ics.predictor_present = !!count;
}
/**
* Mark LTP sfb's
*/
void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce,
int common_window)
{
int w, g, w2, i, start = 0, count = 0;
int saved_bits = -(15 + FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB));
float *C34 = &s->scoefs[128*0], *PCD = &s->scoefs[128*1];
float *PCD34 = &s->scoefs[128*2];
const int max_ltp = FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB);
if (sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
if (sce->ics.ltp.lag) {
memset(&sce->ltp_state[0], 0, 3072*sizeof(sce->ltp_state[0]));
memset(&sce->ics.ltp, 0, sizeof(LongTermPrediction));
}
return;
}
if (!sce->ics.ltp.lag || s->lambda > 120.0f)
return;
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce->ics.num_swb; g++) {
int bits1 = 0, bits2 = 0;
float dist1 = 0.0f, dist2 = 0.0f;
if (w*16+g > max_ltp) {
start += sce->ics.swb_sizes[g];
continue;
}
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int bits_tmp1, bits_tmp2;
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
for (i = 0; i < sce->ics.swb_sizes[g]; i++)
PCD[i] = sce->coeffs[start+(w+w2)*128+i] - sce->lcoeffs[start+(w+w2)*128+i];
s->abs_pow34(C34, &sce->coeffs[start+(w+w2)*128], sce->ics.swb_sizes[g]);
s->abs_pow34(PCD34, PCD, sce->ics.swb_sizes[g]);
dist1 += quantize_band_cost(s, &sce->coeffs[start+(w+w2)*128], C34, sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g], sce->band_type[(w+w2)*16+g],
s->lambda/band->threshold, INFINITY, &bits_tmp1, NULL, 0);
dist2 += quantize_band_cost(s, PCD, PCD34, sce->ics.swb_sizes[g],
sce->sf_idx[(w+w2)*16+g],
sce->band_type[(w+w2)*16+g],
s->lambda/band->threshold, INFINITY, &bits_tmp2, NULL, 0);
bits1 += bits_tmp1;
bits2 += bits_tmp2;
}
if (dist2 < dist1 && bits2 < bits1) {
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++)
for (i = 0; i < sce->ics.swb_sizes[g]; i++)
sce->coeffs[start+(w+w2)*128+i] -= sce->lcoeffs[start+(w+w2)*128+i];
sce->ics.ltp.used[w*16+g] = 1;
saved_bits += bits1 - bits2;
count++;
}
start += sce->ics.swb_sizes[g];
}
}
sce->ics.ltp.present = !!count && (saved_bits >= 0);
sce->ics.predictor_present = !!sce->ics.ltp.present;
/* Reset any marked sfbs */
if (!sce->ics.ltp.present && !!count) {
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce->ics.num_swb; g++) {
if (sce->ics.ltp.used[w*16+g]) {
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
for (i = 0; i < sce->ics.swb_sizes[g]; i++) {
sce->coeffs[start+(w+w2)*128+i] += sce->lcoeffs[start+(w+w2)*128+i];
}
}
}
start += sce->ics.swb_sizes[g];
}
}
}
}

View file

@ -0,0 +1,41 @@
/*
* AAC encoder long term prediction extension
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder long term prediction extension
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_LTP_H
#define AVCODEC_AACENC_LTP_H
#include "aacenc.h"
void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce,
int common_window);
void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce);
void ff_aac_adjust_common_ltp(AACEncContext *s, ChannelElement *cpe);
void ff_aac_ltp_insert_new_frame(AACEncContext *s);
void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce,
int common_window);
#endif /* AVCODEC_AACENC_LTP_H */

View file

@ -0,0 +1,347 @@
/*
* AAC encoder main-type prediction
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder main-type prediction
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#include "aactab.h"
#include "aacenc_pred.h"
#include "aacenc_utils.h"
#include "aacenc_is.h" /* <- Needed for common window distortions */
#include "aacenc_quantization.h"
#define RESTORE_PRED(sce, sfb) \
if (sce->ics.prediction_used[sfb]) {\
sce->ics.prediction_used[sfb] = 0;\
sce->band_type[sfb] = sce->band_alt[sfb];\
}
static inline float flt16_round(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00008000U) & 0xFFFF0000U;
return tmp.f;
}
static inline float flt16_even(float pf)
{
union av_intfloat32 tmp;
tmp.f = pf;
tmp.i = (tmp.i + 0x00007FFFU + (tmp.i & 0x00010000U >> 16)) & 0xFFFF0000U;
return tmp.f;
}
static inline float flt16_trunc(float pf)
{
union av_intfloat32 pun;
pun.f = pf;
pun.i &= 0xFFFF0000U;
return pun.f;
}
static inline void predict(PredictorState *ps, float *coef, float *rcoef, int set)
{
float k2;
const float a = 0.953125; // 61.0 / 64
const float alpha = 0.90625; // 29.0 / 32
const float k1 = ps->k1;
const float r0 = ps->r0, r1 = ps->r1;
const float cor0 = ps->cor0, cor1 = ps->cor1;
const float var0 = ps->var0, var1 = ps->var1;
const float e0 = *coef - ps->x_est;
const float e1 = e0 - k1 * r0;
if (set)
*coef = e0;
ps->cor1 = flt16_trunc(alpha * cor1 + r1 * e1);
ps->var1 = flt16_trunc(alpha * var1 + 0.5f * (r1 * r1 + e1 * e1));
ps->cor0 = flt16_trunc(alpha * cor0 + r0 * e0);
ps->var0 = flt16_trunc(alpha * var0 + 0.5f * (r0 * r0 + e0 * e0));
ps->r1 = flt16_trunc(a * (r0 - k1 * e0));
ps->r0 = flt16_trunc(a * e0);
/* Prediction for next frame */
ps->k1 = ps->var0 > 1 ? ps->cor0 * flt16_even(a / ps->var0) : 0;
k2 = ps->var1 > 1 ? ps->cor1 * flt16_even(a / ps->var1) : 0;
*rcoef = ps->x_est = flt16_round(ps->k1*ps->r0 + k2*ps->r1);
}
static inline void reset_predict_state(PredictorState *ps)
{
ps->r0 = 0.0f;
ps->r1 = 0.0f;
ps->k1 = 0.0f;
ps->cor0 = 0.0f;
ps->cor1 = 0.0f;
ps->var0 = 1.0f;
ps->var1 = 1.0f;
ps->x_est = 0.0f;
}
static inline void reset_all_predictors(PredictorState *ps)
{
int i;
for (i = 0; i < MAX_PREDICTORS; i++)
reset_predict_state(&ps[i]);
}
static inline void reset_predictor_group(SingleChannelElement *sce, int group_num)
{
int i;
PredictorState *ps = sce->predictor_state;
for (i = group_num - 1; i < MAX_PREDICTORS; i += 30)
reset_predict_state(&ps[i]);
}
void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce)
{
int sfb, k;
const int pmax = FFMIN(sce->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {
for (sfb = 0; sfb < pmax; sfb++) {
for (k = sce->ics.swb_offset[sfb]; k < sce->ics.swb_offset[sfb + 1]; k++) {
predict(&sce->predictor_state[k], &sce->coeffs[k], &sce->prcoeffs[k],
sce->ics.predictor_present && sce->ics.prediction_used[sfb]);
}
}
if (sce->ics.predictor_reset_group) {
reset_predictor_group(sce, sce->ics.predictor_reset_group);
}
} else {
reset_all_predictors(sce->predictor_state);
}
}
/* If inc = 0 you can check if this returns 0 to see if you can reset freely */
static inline int update_counters(IndividualChannelStream *ics, int inc)
{
int i;
for (i = 1; i < 31; i++) {
ics->predictor_reset_count[i] += inc;
if (ics->predictor_reset_count[i] > PRED_RESET_FRAME_MIN)
return i; /* Reset this immediately */
}
return 0;
}
void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe)
{
int start, w, w2, g, i, count = 0;
SingleChannelElement *sce0 = &cpe->ch[0];
SingleChannelElement *sce1 = &cpe->ch[1];
const int pmax0 = FFMIN(sce0->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
const int pmax1 = FFMIN(sce1->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
const int pmax = FFMIN(pmax0, pmax1);
if (!cpe->common_window ||
sce0->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE ||
sce1->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE)
return;
for (w = 0; w < sce0->ics.num_windows; w += sce0->ics.group_len[w]) {
start = 0;
for (g = 0; g < sce0->ics.num_swb; g++) {
int sfb = w*16+g;
int sum = sce0->ics.prediction_used[sfb] + sce1->ics.prediction_used[sfb];
float ener0 = 0.0f, ener1 = 0.0f, ener01 = 0.0f;
struct AACISError ph_err1, ph_err2, *erf;
if (sfb < PRED_SFB_START || sfb > pmax || sum != 2) {
RESTORE_PRED(sce0, sfb);
RESTORE_PRED(sce1, sfb);
start += sce0->ics.swb_sizes[g];
continue;
}
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
float coef0 = sce0->pcoeffs[start+(w+w2)*128+i];
float coef1 = sce1->pcoeffs[start+(w+w2)*128+i];
ener0 += coef0*coef0;
ener1 += coef1*coef1;
ener01 += (coef0 + coef1)*(coef0 + coef1);
}
}
ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
ener0, ener1, ener01, 1, -1);
ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
ener0, ener1, ener01, 1, +1);
erf = ph_err1.error < ph_err2.error ? &ph_err1 : &ph_err2;
if (erf->pass) {
sce0->ics.prediction_used[sfb] = 1;
sce1->ics.prediction_used[sfb] = 1;
count++;
} else {
RESTORE_PRED(sce0, sfb);
RESTORE_PRED(sce1, sfb);
}
start += sce0->ics.swb_sizes[g];
}
}
sce1->ics.predictor_present = sce0->ics.predictor_present = !!count;
}
static void update_pred_resets(SingleChannelElement *sce)
{
int i, max_group_id_c, max_frame = 0;
float avg_frame = 0.0f;
IndividualChannelStream *ics = &sce->ics;
/* Update the counters and immediately update any frame behind schedule */
if ((ics->predictor_reset_group = update_counters(&sce->ics, 1)))
return;
for (i = 1; i < 31; i++) {
/* Count-based */
if (ics->predictor_reset_count[i] > max_frame) {
max_group_id_c = i;
max_frame = ics->predictor_reset_count[i];
}
avg_frame = (ics->predictor_reset_count[i] + avg_frame)/2;
}
if (max_frame > PRED_RESET_MIN) {
ics->predictor_reset_group = max_group_id_c;
} else {
ics->predictor_reset_group = 0;
}
}
void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce)
{
int sfb, i, count = 0, cost_coeffs = 0, cost_pred = 0;
const int pmax = FFMIN(sce->ics.max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
float *O34 = &s->scoefs[128*0], *P34 = &s->scoefs[128*1];
float *SENT = &s->scoefs[128*2], *S34 = &s->scoefs[128*3];
float *QERR = &s->scoefs[128*4];
if (sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
sce->ics.predictor_present = 0;
return;
}
if (!sce->ics.predictor_initialized) {
reset_all_predictors(sce->predictor_state);
sce->ics.predictor_initialized = 1;
memcpy(sce->prcoeffs, sce->coeffs, 1024*sizeof(float));
for (i = 1; i < 31; i++)
sce->ics.predictor_reset_count[i] = i;
}
update_pred_resets(sce);
memcpy(sce->band_alt, sce->band_type, sizeof(sce->band_type));
for (sfb = PRED_SFB_START; sfb < pmax; sfb++) {
int cost1, cost2, cb_p;
float dist1, dist2, dist_spec_err = 0.0f;
const int cb_n = sce->zeroes[sfb] ? 0 : sce->band_type[sfb];
const int cb_min = sce->zeroes[sfb] ? 0 : 1;
const int cb_max = sce->zeroes[sfb] ? 0 : RESERVED_BT;
const int start_coef = sce->ics.swb_offset[sfb];
const int num_coeffs = sce->ics.swb_offset[sfb + 1] - start_coef;
const FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[sfb];
if (start_coef + num_coeffs > MAX_PREDICTORS ||
(s->cur_channel && sce->band_type[sfb] >= INTENSITY_BT2) ||
sce->band_type[sfb] == NOISE_BT)
continue;
/* Normal coefficients */
s->abs_pow34(O34, &sce->coeffs[start_coef], num_coeffs);
dist1 = quantize_and_encode_band_cost(s, NULL, &sce->coeffs[start_coef], NULL,
O34, num_coeffs, sce->sf_idx[sfb],
cb_n, s->lambda / band->threshold, INFINITY, &cost1, NULL, 0);
cost_coeffs += cost1;
/* Encoded coefficients - needed for #bits, band type and quant. error */
for (i = 0; i < num_coeffs; i++)
SENT[i] = sce->coeffs[start_coef + i] - sce->prcoeffs[start_coef + i];
s->abs_pow34(S34, SENT, num_coeffs);
if (cb_n < RESERVED_BT)
cb_p = av_clip(find_min_book(find_max_val(1, num_coeffs, S34), sce->sf_idx[sfb]), cb_min, cb_max);
else
cb_p = cb_n;
quantize_and_encode_band_cost(s, NULL, SENT, QERR, S34, num_coeffs,
sce->sf_idx[sfb], cb_p, s->lambda / band->threshold, INFINITY,
&cost2, NULL, 0);
/* Reconstructed coefficients - needed for distortion measurements */
for (i = 0; i < num_coeffs; i++)
sce->prcoeffs[start_coef + i] += QERR[i] != 0.0f ? (sce->prcoeffs[start_coef + i] - QERR[i]) : 0.0f;
s->abs_pow34(P34, &sce->prcoeffs[start_coef], num_coeffs);
if (cb_n < RESERVED_BT)
cb_p = av_clip(find_min_book(find_max_val(1, num_coeffs, P34), sce->sf_idx[sfb]), cb_min, cb_max);
else
cb_p = cb_n;
dist2 = quantize_and_encode_band_cost(s, NULL, &sce->prcoeffs[start_coef], NULL,
P34, num_coeffs, sce->sf_idx[sfb],
cb_p, s->lambda / band->threshold, INFINITY, NULL, NULL, 0);
for (i = 0; i < num_coeffs; i++)
dist_spec_err += (O34[i] - P34[i])*(O34[i] - P34[i]);
dist_spec_err *= s->lambda / band->threshold;
dist2 += dist_spec_err;
if (dist2 <= dist1 && cb_p <= cb_n) {
cost_pred += cost2;
sce->ics.prediction_used[sfb] = 1;
sce->band_alt[sfb] = cb_n;
sce->band_type[sfb] = cb_p;
count++;
} else {
cost_pred += cost1;
sce->band_alt[sfb] = cb_p;
}
}
if (count && cost_coeffs < cost_pred) {
count = 0;
for (sfb = PRED_SFB_START; sfb < pmax; sfb++)
RESTORE_PRED(sce, sfb);
memset(&sce->ics.prediction_used, 0, sizeof(sce->ics.prediction_used));
}
sce->ics.predictor_present = !!count;
}
/**
* Encoder predictors data.
*/
void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
{
int sfb;
IndividualChannelStream *ics = &sce->ics;
const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
if (s->profile != FF_PROFILE_AAC_MAIN ||
!ics->predictor_present)
return;
put_bits(&s->pb, 1, !!ics->predictor_reset_group);
if (ics->predictor_reset_group)
put_bits(&s->pb, 5, ics->predictor_reset_group);
for (sfb = 0; sfb < pmax; sfb++)
put_bits(&s->pb, 1, ics->prediction_used[sfb]);
}

View file

@ -0,0 +1,47 @@
/*
* AAC encoder main-type prediction
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder main-type prediction
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_PRED_H
#define AVCODEC_AACENC_PRED_H
#include "aacenc.h"
/* Every predictor group needs to get reset at least once in this many frames */
#define PRED_RESET_FRAME_MIN 240
/* Any frame with less than this amount of frames since last reset is ok */
#define PRED_RESET_MIN 64
/* Raise to filter any low frequency artifacts due to prediction */
#define PRED_SFB_START 10
void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce);
void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe);
void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce);
void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce);
#endif /* AVCODEC_AACENC_PRED_H */

View file

@ -0,0 +1,283 @@
/*
* AAC encoder quantizer
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder quantizer
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_QUANTIZATION_H
#define AVCODEC_AACENC_QUANTIZATION_H
#include "aactab.h"
#include "aacenc.h"
#include "aacenctab.h"
#include "aacenc_utils.h"
/**
* Calculate rate distortion cost for quantizing with given codebook
*
* @return quantization distortion
*/
static av_always_inline float quantize_and_encode_band_cost_template(
struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int BT_ZERO, int BT_UNSIGNED,
int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO,
const float ROUNDING)
{
const int q_idx = POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512;
const float Q = ff_aac_pow2sf_tab [q_idx];
const float Q34 = ff_aac_pow34sf_tab[q_idx];
const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
const float CLIPPED_ESCAPE = 165140.0f*IQ;
int i, j;
float cost = 0;
float qenergy = 0;
const int dim = BT_PAIR ? 2 : 4;
int resbits = 0;
int off;
if (BT_ZERO || BT_NOISE || BT_STEREO) {
for (i = 0; i < size; i++)
cost += in[i]*in[i];
if (bits)
*bits = 0;
if (energy)
*energy = qenergy;
if (out) {
for (i = 0; i < size; i += dim)
for (j = 0; j < dim; j++)
out[i+j] = 0.0f;
}
return cost * lambda;
}
if (!scaled) {
s->abs_pow34(s->scoefs, in, size);
scaled = s->scoefs;
}
s->quant_bands(s->qcoefs, in, scaled, size, !BT_UNSIGNED, aac_cb_maxval[cb], Q34, ROUNDING);
if (BT_UNSIGNED) {
off = 0;
} else {
off = aac_cb_maxval[cb];
}
for (i = 0; i < size; i += dim) {
const float *vec;
int *quants = s->qcoefs + i;
int curidx = 0;
int curbits;
float quantized, rd = 0.0f;
for (j = 0; j < dim; j++) {
curidx *= aac_cb_range[cb];
curidx += quants[j] + off;
}
curbits = ff_aac_spectral_bits[cb-1][curidx];
vec = &ff_aac_codebook_vectors[cb-1][curidx*dim];
if (BT_UNSIGNED) {
for (j = 0; j < dim; j++) {
float t = fabsf(in[i+j]);
float di;
if (BT_ESC && vec[j] == 64.0f) { //FIXME: slow
if (t >= CLIPPED_ESCAPE) {
quantized = CLIPPED_ESCAPE;
curbits += 21;
} else {
int c = av_clip_uintp2(quant(t, Q, ROUNDING), 13);
quantized = c*cbrtf(c)*IQ;
curbits += av_log2(c)*2 - 4 + 1;
}
} else {
quantized = vec[j]*IQ;
}
di = t - quantized;
if (out)
out[i+j] = in[i+j] >= 0 ? quantized : -quantized;
if (vec[j] != 0.0f)
curbits++;
qenergy += quantized*quantized;
rd += di*di;
}
} else {
for (j = 0; j < dim; j++) {
quantized = vec[j]*IQ;
qenergy += quantized*quantized;
if (out)
out[i+j] = quantized;
rd += (in[i+j] - quantized)*(in[i+j] - quantized);
}
}
cost += rd * lambda + curbits;
resbits += curbits;
if (cost >= uplim)
return uplim;
if (pb) {
put_bits(pb, ff_aac_spectral_bits[cb-1][curidx], ff_aac_spectral_codes[cb-1][curidx]);
if (BT_UNSIGNED)
for (j = 0; j < dim; j++)
if (ff_aac_codebook_vectors[cb-1][curidx*dim+j] != 0.0f)
put_bits(pb, 1, in[i+j] < 0.0f);
if (BT_ESC) {
for (j = 0; j < 2; j++) {
if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, ROUNDING), 13);
int len = av_log2(coef);
put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
put_sbits(pb, len, coef);
}
}
}
}
}
if (bits)
*bits = resbits;
if (energy)
*energy = qenergy;
return cost;
}
static inline float quantize_and_encode_band_cost_NONE(struct AACEncContext *s, PutBitContext *pb,
const float *in, float *quant, const float *scaled,
int size, int scale_idx, int cb,
const float lambda, const float uplim,
int *bits, float *energy) {
av_assert0(0);
return 0.0f;
}
#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, ROUNDING) \
static float quantize_and_encode_band_cost_ ## NAME( \
struct AACEncContext *s, \
PutBitContext *pb, const float *in, float *quant, \
const float *scaled, int size, int scale_idx, \
int cb, const float lambda, const float uplim, \
int *bits, float *energy) { \
return quantize_and_encode_band_cost_template( \
s, pb, in, quant, scaled, size, scale_idx, \
BT_ESC ? ESC_BT : cb, lambda, uplim, bits, energy, \
BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, \
ROUNDING); \
}
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ZERO, 1, 0, 0, 0, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SQUAD, 0, 0, 0, 0, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UQUAD, 0, 1, 0, 0, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(SPAIR, 0, 0, 1, 0, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(UPAIR, 0, 1, 1, 0, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC, 0, 1, 1, 1, 0, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(ESC_RTZ, 0, 1, 1, 1, 0, 0, ROUND_TO_ZERO)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NOISE, 0, 0, 0, 0, 1, 0, ROUND_STANDARD)
QUANTIZE_AND_ENCODE_BAND_COST_FUNC(STEREO,0, 0, 0, 0, 0, 1, ROUND_STANDARD)
static float (*const quantize_and_encode_band_cost_arr[])(
struct AACEncContext *s,
PutBitContext *pb, const float *in, float *quant,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy) = {
quantize_and_encode_band_cost_ZERO,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_ESC,
quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */
quantize_and_encode_band_cost_NOISE,
quantize_and_encode_band_cost_STEREO,
quantize_and_encode_band_cost_STEREO,
};
static float (*const quantize_and_encode_band_cost_rtz_arr[])(
struct AACEncContext *s,
PutBitContext *pb, const float *in, float *quant,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy) = {
quantize_and_encode_band_cost_ZERO,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_ESC_RTZ,
quantize_and_encode_band_cost_NONE, /* CB 12 doesn't exist */
quantize_and_encode_band_cost_NOISE,
quantize_and_encode_band_cost_STEREO,
quantize_and_encode_band_cost_STEREO,
};
#define quantize_and_encode_band_cost( \
s, pb, in, quant, scaled, size, scale_idx, cb, \
lambda, uplim, bits, energy, rtz) \
((rtz) ? quantize_and_encode_band_cost_rtz_arr : quantize_and_encode_band_cost_arr)[cb]( \
s, pb, in, quant, scaled, size, scale_idx, cb, \
lambda, uplim, bits, energy)
static inline float quantize_band_cost(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
{
return quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx,
cb, lambda, uplim, bits, energy, rtz);
}
static inline int quantize_band_cost_bits(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
{
int auxbits;
quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx,
cb, 0.0f, uplim, &auxbits, energy, rtz);
if (bits) {
*bits = auxbits;
}
return auxbits;
}
static inline void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb,
const float *in, float *out, int size, int scale_idx,
int cb, const float lambda, int rtz)
{
quantize_and_encode_band_cost(s, pb, in, out, NULL, size, scale_idx, cb, lambda,
INFINITY, NULL, NULL, rtz);
}
#include "aacenc_quantization_misc.h"
#endif /* AVCODEC_AACENC_QUANTIZATION_H */

View file

@ -0,0 +1,53 @@
/*
* AAC encoder quantization
* Copyright (C) 2015 Claudio Freire
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder quantization misc reusable function templates
* @author Claudio Freire ( klaussfreire gmail com )
*/
#ifndef AVCODEC_AACENC_QUANTIZATION_MISC_H
#define AVCODEC_AACENC_QUANTIZATION_MISC_H
static inline float quantize_band_cost_cached(struct AACEncContext *s, int w, int g, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, float *energy, int rtz)
{
AACQuantizeBandCostCacheEntry *entry;
av_assert1(scale_idx >= 0 && scale_idx < 256);
entry = &s->quantize_band_cost_cache[scale_idx][w*16+g];
if (entry->generation != s->quantize_band_cost_cache_generation || entry->cb != cb || entry->rtz != rtz) {
entry->rd = quantize_band_cost(s, in, scaled, size, scale_idx,
cb, lambda, uplim, &entry->bits, &entry->energy, rtz);
entry->cb = cb;
entry->rtz = rtz;
entry->generation = s->quantize_band_cost_cache_generation;
}
if (bits)
*bits = entry->bits;
if (energy)
*energy = entry->energy;
return entry->rd;
}
#endif /* AVCODEC_AACENC_QUANTIZATION_MISC_H */

View file

@ -0,0 +1,215 @@
/*
* AAC encoder TNS
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder temporal noise shaping
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#include "libavutil/libm.h"
#include "aacenc.h"
#include "aacenc_tns.h"
#include "aactab.h"
#include "aacenc_utils.h"
#include "aacenc_quantization.h"
/* Could be set to 3 to save an additional bit at the cost of little quality */
#define TNS_Q_BITS 4
/* Coefficient resolution in short windows */
#define TNS_Q_BITS_IS8 4
/* We really need the bits we save here elsewhere */
#define TNS_ENABLE_COEF_COMPRESSION
/* TNS will only be used if the LPC gain is within these margins */
#define TNS_GAIN_THRESHOLD_LOW 1.4f
#define TNS_GAIN_THRESHOLD_HIGH 1.16f*TNS_GAIN_THRESHOLD_LOW
static inline int compress_coeffs(int *coef, int order, int c_bits)
{
int i;
const int low_idx = c_bits ? 4 : 2;
const int shift_val = c_bits ? 8 : 4;
const int high_idx = c_bits ? 11 : 5;
#ifndef TNS_ENABLE_COEF_COMPRESSION
return 0;
#endif /* TNS_ENABLE_COEF_COMPRESSION */
for (i = 0; i < order; i++)
if (coef[i] >= low_idx && coef[i] <= high_idx)
return 0;
for (i = 0; i < order; i++)
coef[i] -= (coef[i] > high_idx) ? shift_val : 0;
return 1;
}
/**
* Encode TNS data.
* Coefficient compression is simply not lossless as it should be
* on any decoder tested and as such is not active.
*/
void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce)
{
TemporalNoiseShaping *tns = &sce->tns;
int i, w, filt, coef_compress = 0, coef_len;
const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
if (!sce->tns.present)
return;
for (i = 0; i < sce->ics.num_windows; i++) {
put_bits(&s->pb, 2 - is8, sce->tns.n_filt[i]);
if (!tns->n_filt[i])
continue;
put_bits(&s->pb, 1, c_bits);
for (filt = 0; filt < tns->n_filt[i]; filt++) {
put_bits(&s->pb, 6 - 2 * is8, tns->length[i][filt]);
put_bits(&s->pb, 5 - 2 * is8, tns->order[i][filt]);
if (!tns->order[i][filt])
continue;
put_bits(&s->pb, 1, tns->direction[i][filt]);
coef_compress = compress_coeffs(tns->coef_idx[i][filt],
tns->order[i][filt], c_bits);
put_bits(&s->pb, 1, coef_compress);
coef_len = c_bits + 3 - coef_compress;
for (w = 0; w < tns->order[i][filt]; w++)
put_bits(&s->pb, coef_len, tns->coef_idx[i][filt][w]);
}
}
}
/* Apply TNS filter */
void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
{
TemporalNoiseShaping *tns = &sce->tns;
IndividualChannelStream *ics = &sce->ics;
int w, filt, m, i, top, order, bottom, start, end, size, inc;
const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb);
float lpc[TNS_MAX_ORDER];
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
for (filt = 0; filt < tns->n_filt[w]; filt++) {
top = bottom;
bottom = FFMAX(0, top - tns->length[w][filt]);
order = tns->order[w][filt];
if (order == 0)
continue;
// tns_decode_coef
compute_lpc_coefs(tns->coef[w][filt], order, lpc, 0, 0, 0);
start = ics->swb_offset[FFMIN(bottom, mmm)];
end = ics->swb_offset[FFMIN( top, mmm)];
if ((size = end - start) <= 0)
continue;
if (tns->direction[w][filt]) {
inc = -1;
start = end - 1;
} else {
inc = 1;
}
start += w * 128;
/* AR filter */
for (m = 0; m < size; m++, start += inc) {
for (i = 1; i <= FFMIN(m, order); i++) {
sce->coeffs[start] += lpc[i-1]*sce->pcoeffs[start - i*inc];
}
}
}
}
}
/*
* c_bits - 1 if 4 bit coefficients, 0 if 3 bit coefficients
*/
static inline void quantize_coefs(double *coef, int *idx, float *lpc, int order,
int c_bits)
{
int i;
const float *quant_arr = tns_tmp2_map[c_bits];
for (i = 0; i < order; i++) {
idx[i] = quant_array_idx(coef[i], quant_arr, c_bits ? 16 : 8);
lpc[i] = quant_arr[idx[i]];
}
}
/*
* 3 bits per coefficient with 8 short windows
*/
void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
{
TemporalNoiseShaping *tns = &sce->tns;
int w, g, count = 0;
double gain, coefs[MAX_LPC_ORDER];
const int mmm = FFMIN(sce->ics.tns_max_bands, sce->ics.max_sfb);
const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm);
const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER;
const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 :
sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
const int sfb_len = sfb_end - sfb_start;
const int coef_len = sce->ics.swb_offset[sfb_end] - sce->ics.swb_offset[sfb_start];
if (coef_len <= 0 || sfb_len <= 0) {
sce->tns.present = 0;
return;
}
for (w = 0; w < sce->ics.num_windows; w++) {
float en[2] = {0.0f, 0.0f};
int oc_start = 0, os_start = 0;
int coef_start = sce->ics.swb_offset[sfb_start];
for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
if (g > sfb_start + (sfb_len/2))
en[1] += band->energy;
else
en[0] += band->energy;
}
/* LPC */
gain = ff_lpc_calc_ref_coefs_f(&s->lpc, &sce->coeffs[w*128 + coef_start],
coef_len, order, coefs);
if (!order || !isfinite(gain) || gain < TNS_GAIN_THRESHOLD_LOW || gain > TNS_GAIN_THRESHOLD_HIGH)
continue;
tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
for (g = 0; g < tns->n_filt[w]; g++) {
tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];
tns->order[w][g] = g < tns->n_filt[w] ? order/tns->n_filt[w] : order - oc_start;
tns->length[w][g] = g < tns->n_filt[w] ? sfb_len/tns->n_filt[w] : sfb_len - os_start;
quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g],
tns->order[w][g], c_bits);
oc_start += tns->order[w][g];
os_start += tns->length[w][g];
}
count++;
}
sce->tns.present = !!count;
}

View file

@ -0,0 +1,37 @@
/*
* AAC encoder TNS
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder temporal noise shaping
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_TNS_H
#define AVCODEC_AACENC_TNS_H
#include "aacenc.h"
void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce);
void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce);
void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce);
#endif /* AVCODEC_AACENC_TNS_H */

View file

@ -0,0 +1,279 @@
/*
* AAC encoder utilities
* Copyright (C) 2015 Rostislav Pehlivanov
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder utilities
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENC_UTILS_H
#define AVCODEC_AACENC_UTILS_H
#include "libavutil/ffmath.h"
#include "aac.h"
#include "aacenctab.h"
#include "aactab.h"
#define ROUND_STANDARD 0.4054f
#define ROUND_TO_ZERO 0.1054f
#define C_QUANT 0.4054f
static inline void abs_pow34_v(float *out, const float *in, const int size)
{
int i;
for (i = 0; i < size; i++) {
float a = fabsf(in[i]);
out[i] = sqrtf(a * sqrtf(a));
}
}
static inline float pos_pow34(float a)
{
return sqrtf(a * sqrtf(a));
}
/**
* Quantize one coefficient.
* @return absolute value of the quantized coefficient
* @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
*/
static inline int quant(float coef, const float Q, const float rounding)
{
float a = coef * Q;
return sqrtf(a * sqrtf(a)) + rounding;
}
static inline void quantize_bands(int *out, const float *in, const float *scaled,
int size, int is_signed, int maxval, const float Q34,
const float rounding)
{
int i;
for (i = 0; i < size; i++) {
float qc = scaled[i] * Q34;
int tmp = (int)FFMIN(qc + rounding, (float)maxval);
if (is_signed && in[i] < 0.0f) {
tmp = -tmp;
}
out[i] = tmp;
}
}
static inline float find_max_val(int group_len, int swb_size, const float *scaled)
{
float maxval = 0.0f;
int w2, i;
for (w2 = 0; w2 < group_len; w2++) {
for (i = 0; i < swb_size; i++) {
maxval = FFMAX(maxval, scaled[w2*128+i]);
}
}
return maxval;
}
static inline int find_min_book(float maxval, int sf)
{
float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
int qmaxval, cb;
qmaxval = maxval * Q34 + C_QUANT;
if (qmaxval >= (FF_ARRAY_ELEMS(aac_maxval_cb)))
cb = 11;
else
cb = aac_maxval_cb[qmaxval];
return cb;
}
static inline float find_form_factor(int group_len, int swb_size, float thresh,
const float *scaled, float nzslope) {
const float iswb_size = 1.0f / swb_size;
const float iswb_sizem1 = 1.0f / (swb_size - 1);
const float ethresh = thresh;
float form = 0.0f, weight = 0.0f;
int w2, i;
for (w2 = 0; w2 < group_len; w2++) {
float e = 0.0f, e2 = 0.0f, var = 0.0f, maxval = 0.0f;
float nzl = 0;
for (i = 0; i < swb_size; i++) {
float s = fabsf(scaled[w2*128+i]);
maxval = FFMAX(maxval, s);
e += s;
e2 += s *= s;
/* We really don't want a hard non-zero-line count, since
* even below-threshold lines do add up towards band spectral power.
* So, fall steeply towards zero, but smoothly
*/
if (s >= ethresh) {
nzl += 1.0f;
} else {
if (nzslope == 2.f)
nzl += (s / ethresh) * (s / ethresh);
else
nzl += ff_fast_powf(s / ethresh, nzslope);
}
}
if (e2 > thresh) {
float frm;
e *= iswb_size;
/** compute variance */
for (i = 0; i < swb_size; i++) {
float d = fabsf(scaled[w2*128+i]) - e;
var += d*d;
}
var = sqrtf(var * iswb_sizem1);
e2 *= iswb_size;
frm = e / FFMIN(e+4*var,maxval);
form += e2 * sqrtf(frm) / FFMAX(0.5f,nzl);
weight += e2;
}
}
if (weight > 0) {
return form / weight;
} else {
return 1.0f;
}
}
/** Return the minimum scalefactor where the quantized coef does not clip. */
static inline uint8_t coef2minsf(float coef)
{
return av_clip_uint8(log2f(coef)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512);
}
/** Return the maximum scalefactor where the quantized coef is not zero. */
static inline uint8_t coef2maxsf(float coef)
{
return av_clip_uint8(log2f(coef)*4 + 6 + SCALE_ONE_POS - SCALE_DIV_512);
}
/*
* Returns the closest possible index to an array of float values, given a value.
*/
static inline int quant_array_idx(const float val, const float *arr, const int num)
{
int i, index = 0;
float quant_min_err = INFINITY;
for (i = 0; i < num; i++) {
float error = (val - arr[i])*(val - arr[i]);
if (error < quant_min_err) {
quant_min_err = error;
index = i;
}
}
return index;
}
/**
* approximates exp10f(-3.0f*(0.5f + 0.5f * cosf(FFMIN(b,15.5f) / 15.5f)))
*/
static av_always_inline float bval2bmax(float b)
{
return 0.001f + 0.0035f * (b*b*b) / (15.5f*15.5f*15.5f);
}
/*
* Compute a nextband map to be used with SF delta constraint utilities.
* The nextband array should contain 128 elements, and positions that don't
* map to valid, nonzero bands of the form w*16+g (with w being the initial
* window of the window group, only) are left indetermined.
*/
static inline void ff_init_nextband_map(const SingleChannelElement *sce, uint8_t *nextband)
{
unsigned char prevband = 0;
int w, g;
/** Just a safe default */
for (g = 0; g < 128; g++)
nextband[g] = g;
/** Now really navigate the nonzero band chain */
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
for (g = 0; g < sce->ics.num_swb; g++) {
if (!sce->zeroes[w*16+g] && sce->band_type[w*16+g] < RESERVED_BT)
prevband = nextband[prevband] = w*16+g;
}
}
nextband[prevband] = prevband; /* terminate */
}
/*
* Updates nextband to reflect a removed band (equivalent to
* calling ff_init_nextband_map after marking a band as zero)
*/
static inline void ff_nextband_remove(uint8_t *nextband, int prevband, int band)
{
nextband[prevband] = nextband[band];
}
/*
* Checks whether the specified band could be removed without inducing
* scalefactor delta that violates SF delta encoding constraints.
* prev_sf has to be the scalefactor of the previous nonzero, nonspecial
* band, in encoding order, or negative if there was no such band.
*/
static inline int ff_sfdelta_can_remove_band(const SingleChannelElement *sce,
const uint8_t *nextband, int prev_sf, int band)
{
return prev_sf >= 0
&& sce->sf_idx[nextband[band]] >= (prev_sf - SCALE_MAX_DIFF)
&& sce->sf_idx[nextband[band]] <= (prev_sf + SCALE_MAX_DIFF);
}
/*
* Checks whether the specified band's scalefactor could be replaced
* with another one without violating SF delta encoding constraints.
* prev_sf has to be the scalefactor of the previous nonzero, nonsepcial
* band, in encoding order, or negative if there was no such band.
*/
static inline int ff_sfdelta_can_replace(const SingleChannelElement *sce,
const uint8_t *nextband, int prev_sf, int new_sf, int band)
{
return new_sf >= (prev_sf - SCALE_MAX_DIFF)
&& new_sf <= (prev_sf + SCALE_MAX_DIFF)
&& sce->sf_idx[nextband[band]] >= (new_sf - SCALE_MAX_DIFF)
&& sce->sf_idx[nextband[band]] <= (new_sf + SCALE_MAX_DIFF);
}
/**
* linear congruential pseudorandom number generator
*
* @param previous_val pointer to the current state of the generator
*
* @return Returns a 32-bit pseudorandom integer
*/
static av_always_inline int lcg_random(unsigned previous_val)
{
union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
return v.s;
}
#define ERROR_IF(cond, ...) \
if (cond) { \
av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
return AVERROR(EINVAL); \
}
#define WARN_IF(cond, ...) \
if (cond) { \
av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \
}
#endif /* AVCODEC_AACENC_UTILS_H */

View file

@ -0,0 +1,86 @@
;******************************************************************************
;* SIMD optimized AAC encoder DSP functions
;*
;* Copyright (C) 2016 Rostislav Pehlivanov <atomnuker@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg 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.
;*
;* FFmpeg 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 FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
float_abs_mask: times 4 dd 0x7fffffff
SECTION .text
;*******************************************************************
;void ff_abs_pow34(float *out, const float *in, const int size);
;*******************************************************************
INIT_XMM sse
cglobal abs_pow34, 3, 3, 3, out, in, size
mova m2, [float_abs_mask]
shl sizeq, 2
add inq, sizeq
add outq, sizeq
neg sizeq
.loop:
andps m0, m2, [inq+sizeq]
sqrtps m1, m0
mulps m0, m1
sqrtps m0, m0
mova [outq+sizeq], m0
add sizeq, mmsize
jl .loop
RET
;*******************************************************************
;void ff_aac_quantize_bands(int *out, const float *in, const float *scaled,
; int size, int is_signed, int maxval, const float Q34,
; const float rounding)
;*******************************************************************
INIT_XMM sse2
cglobal aac_quantize_bands, 5, 5, 6, out, in, scaled, size, is_signed, maxval, Q34, rounding
%if UNIX64 == 0
movss m0, Q34m
movss m1, roundingm
cvtsi2ss m3, dword maxvalm
%else
cvtsi2ss m3, maxvald
%endif
shufps m0, m0, 0
shufps m1, m1, 0
shufps m3, m3, 0
shl is_signedd, 31
movd m4, is_signedd
shufps m4, m4, 0
shl sized, 2
add inq, sizeq
add outq, sizeq
add scaledq, sizeq
neg sizeq
.loop:
mulps m2, m0, [scaledq+sizeq]
addps m2, m1
minps m2, m3
andps m5, m4, [inq+sizeq]
orps m2, m5
cvttps2dq m2, m2
mova [outq+sizeq], m2
add sizeq, mmsize
jl .loop
RET

View file

@ -0,0 +1,43 @@
/*
* AAC encoder assembly optimizations
* Copyright (C) 2016 Rostislav Pehlivanov <atomnuker@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "libavutil/float_dsp.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/aacenc.h"
void ff_abs_pow34_sse(float *out, const float *in, const int size);
void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled,
int size, int is_signed, int maxval, const float Q34,
const float rounding);
av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
{
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_SSE(cpu_flags))
s->abs_pow34 = ff_abs_pow34_sse;
if (EXTERNAL_SSE2(cpu_flags))
s->quant_bands = ff_aac_quantize_bands_sse2;
}

View file

@ -0,0 +1,108 @@
/*
* AAC encoder data
* Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "aacenctab.h"
static const uint8_t swb_size_128_96[] = {
4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
};
static const uint8_t swb_size_128_64[] = {
4, 4, 4, 4, 4, 4, 8, 8, 8, 16, 28, 36
};
static const uint8_t swb_size_128_48[] = {
4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16
};
static const uint8_t swb_size_128_24[] = {
4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 20
};
static const uint8_t swb_size_128_16[] = {
4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 12, 12, 16, 20, 20
};
static const uint8_t swb_size_128_8[] = {
4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, 16, 20, 20
};
static const uint8_t swb_size_1024_96[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
12, 12, 12, 12, 12, 16, 16, 24, 28, 36, 44,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
};
static const uint8_t swb_size_1024_64[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8,
12, 12, 12, 16, 16, 16, 20, 24, 24, 28, 36,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
};
static const uint8_t swb_size_1024_48[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
96
};
static const uint8_t swb_size_1024_32[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
12, 12, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
};
static const uint8_t swb_size_1024_24[] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
12, 12, 12, 12, 16, 16, 16, 20, 20, 24, 24, 28, 28,
32, 36, 36, 40, 44, 48, 52, 52, 64, 64, 64, 64, 64
};
static const uint8_t swb_size_1024_16[] = {
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
12, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 20, 20, 20, 24, 24, 28, 28,
32, 36, 40, 40, 44, 48, 52, 56, 60, 64, 64, 64
};
static const uint8_t swb_size_1024_8[] = {
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 28, 28,
32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80
};
const uint8_t *ff_aac_swb_size_128[] = {
swb_size_128_96, swb_size_128_96, swb_size_128_64,
swb_size_128_48, swb_size_128_48, swb_size_128_48,
swb_size_128_24, swb_size_128_24, swb_size_128_16,
swb_size_128_16, swb_size_128_16, swb_size_128_8,
swb_size_128_8
};
const uint8_t *ff_aac_swb_size_1024[] = {
swb_size_1024_96, swb_size_1024_96, swb_size_1024_64,
swb_size_1024_48, swb_size_1024_48, swb_size_1024_32,
swb_size_1024_24, swb_size_1024_24, swb_size_1024_16,
swb_size_1024_16, swb_size_1024_16, swb_size_1024_8,
swb_size_1024_8
};
const int ff_aac_swb_size_128_len = FF_ARRAY_ELEMS(ff_aac_swb_size_128);
const int ff_aac_swb_size_1024_len = FF_ARRAY_ELEMS(ff_aac_swb_size_1024);

View file

@ -0,0 +1,139 @@
/*
* AAC encoder data
* Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC encoder data
* @author Rostislav Pehlivanov ( atomnuker gmail com )
*/
#ifndef AVCODEC_AACENCTAB_H
#define AVCODEC_AACENCTAB_H
#include "aac.h"
/** Total number of usable codebooks **/
#define CB_TOT 12
/** Total number of codebooks, including special ones **/
#define CB_TOT_ALL 15
#define AAC_MAX_CHANNELS 16
extern const uint8_t *ff_aac_swb_size_1024[];
extern const int ff_aac_swb_size_1024_len;
extern const uint8_t *ff_aac_swb_size_128[];
extern const int ff_aac_swb_size_128_len;
/* Supported layouts without using a PCE */
static const int64_t aac_normal_chan_layouts[7] = {
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_SURROUND,
AV_CH_LAYOUT_4POINT0,
AV_CH_LAYOUT_5POINT0_BACK,
AV_CH_LAYOUT_5POINT1_BACK,
AV_CH_LAYOUT_7POINT1,
};
/** default channel configurations */
static const uint8_t aac_chan_configs[AAC_MAX_CHANNELS][6] = {
{1, TYPE_SCE}, // 1 channel - single channel element
{1, TYPE_CPE}, // 2 channels - channel pair
{2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
{3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
{3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
{4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
{0}, // 7 channels - invalid without PCE
{5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 8 channels - front center + front stereo + side stereo + back stereo + LFE
};
/**
* Table to remap channels from libavcodec's default order to AAC order.
*/
static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = {
{ 0 },
{ 0, 1 },
{ 2, 0, 1 },
{ 2, 0, 1, 3 },
{ 2, 0, 1, 3, 4 },
{ 2, 0, 1, 4, 5, 3 },
{ 0 },
{ 2, 0, 1, 6, 7, 4, 5, 3 },
};
/* duplicated from avpriv_mpeg4audio_sample_rates to avoid shared build
* failures */
static const int mpeg4audio_sample_rates[16] = {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 7350
};
/** bits needed to code codebook run value for long windows */
static const uint8_t run_value_bits_long[64] = {
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
};
/** bits needed to code codebook run value for short windows */
static const uint8_t run_value_bits_short[16] = {
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
};
/* TNS starting SFBs for long and short windows */
static const uint8_t tns_min_sfb_short[16] = {
2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12, 12, 12, 12, 12
};
static const uint8_t tns_min_sfb_long[16] = {
12, 13, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31, 31, 31, 31, 31
};
static const uint8_t * const tns_min_sfb[2] = {
tns_min_sfb_long, tns_min_sfb_short
};
static const uint8_t * const run_value_bits[2] = {
run_value_bits_long, run_value_bits_short
};
/** Map to convert values from BandCodingPath index to a codebook index **/
static const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15};
/** Inverse map to convert from codebooks to BandCodingPath indices **/
static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14};
static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
static const unsigned char aac_maxval_cb[] = {
0, 1, 3, 5, 5, 7, 7, 7, 9, 9, 9, 9, 9, 11
};
static const int aacenc_profiles[] = {
FF_PROFILE_AAC_MAIN,
FF_PROFILE_AAC_LOW,
FF_PROFILE_AAC_LTP,
FF_PROFILE_MPEG2_AAC_LOW,
};
#endif /* AVCODEC_AACENCTAB_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,86 @@
/*
* MPEG-4 Parametric Stereo definitions and declarations
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACPS_H
#define AVCODEC_AACPS_H
#include <stdint.h>
#include "aacpsdsp.h"
#include "avcodec.h"
#include "get_bits.h"
#define PS_MAX_NUM_ENV 5
#define PS_MAX_NR_IIDICC 34
#define PS_MAX_NR_IPDOPD 17
#define PS_MAX_SSB 91
#define PS_MAX_AP_BANDS 50
#define PS_QMF_TIME_SLOTS 32
#define PS_MAX_DELAY 14
#define PS_AP_LINKS 3
#define PS_MAX_AP_DELAY 5
typedef struct PSContext {
int start;
int enable_iid;
int iid_quant;
int nr_iid_par;
int nr_ipdopd_par;
int enable_icc;
int icc_mode;
int nr_icc_par;
int enable_ext;
int frame_class;
int num_env_old;
int num_env;
int enable_ipdopd;
int border_position[PS_MAX_NUM_ENV+1];
int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Intensity Difference Parameters
int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-Channel Coherence Parameters
/* ipd/opd is iid/icc sized so that the same functions can handle both */
int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Phase Difference Parameters
int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters
int is34bands;
int is34bands_old;
DECLARE_ALIGNED(16, INTFLOAT, in_buf)[5][44][2];
DECLARE_ALIGNED(16, INTFLOAT, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
DECLARE_ALIGNED(16, INTFLOAT, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
DECLARE_ALIGNED(16, INTFLOAT, peak_decay_nrg)[34];
DECLARE_ALIGNED(16, INTFLOAT, power_smooth)[34];
DECLARE_ALIGNED(16, INTFLOAT, peak_decay_diff_smooth)[34];
DECLARE_ALIGNED(16, INTFLOAT, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
DECLARE_ALIGNED(16, INTFLOAT, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
DECLARE_ALIGNED(16, INTFLOAT, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
DECLARE_ALIGNED(16, INTFLOAT, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
DECLARE_ALIGNED(16, INTFLOAT, Lbuf)[91][32][2];
DECLARE_ALIGNED(16, INTFLOAT, Rbuf)[91][32][2];
int8_t opd_hist[PS_MAX_NR_IIDICC];
int8_t ipd_hist[PS_MAX_NR_IIDICC];
PSDSPContext dsp;
} PSContext;
void AAC_RENAME(ff_ps_init)(void);
void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps);
int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top);
#endif /* AVCODEC_AACPS_H */

View file

@ -0,0 +1,24 @@
/*
* MPEG-4 Parametric Stereo decoding functions
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 1
#include "aacps.c"

View file

@ -0,0 +1,24 @@
/*
* Generate a header file for hardcoded Parametric Stereo tables
*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 1
#include "aacps_tablegen_template.c"

View file

@ -0,0 +1,403 @@
/*
* Header file for hardcoded Parametric Stereo tables
*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Note: Rounding-to-nearest used unless otherwise stated
*
*/
#ifndef AVCODEC_AACPS_FIXED_TABLEGEN_H
#define AVCODEC_AACPS_FIXED_TABLEGEN_H
#include <math.h>
#include <stdint.h>
#if CONFIG_HARDCODED_TABLES
#define ps_tableinit()
#define TABLE_CONST const
#include "libavcodec/aacps_fixed_tables.h"
#else
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "aac_defines.h"
#include "libavutil/softfloat.h"
#define NR_ALLPASS_BANDS20 30
#define NR_ALLPASS_BANDS34 50
#define PS_AP_LINKS 3
#define TABLE_CONST
static int pd_re_smooth[8*8*8];
static int pd_im_smooth[8*8*8];
static int HA[46][8][4];
static int HB[46][8][4];
static DECLARE_ALIGNED(16, int, f20_0_8) [ 8][8][2];
static DECLARE_ALIGNED(16, int, f34_0_12)[12][8][2];
static DECLARE_ALIGNED(16, int, f34_1_8) [ 8][8][2];
static DECLARE_ALIGNED(16, int, f34_2_4) [ 4][8][2];
static TABLE_CONST DECLARE_ALIGNED(16, int, Q_fract_allpass)[2][50][3][2];
static DECLARE_ALIGNED(16, int, phi_fract)[2][50][2];
static const int g0_Q8[] = {
Q31(0.00746082949812f), Q31(0.02270420949825f), Q31(0.04546865930473f), Q31(0.07266113929591f),
Q31(0.09885108575264f), Q31(0.11793710567217f), Q31(0.125f)
};
static const int g0_Q12[] = {
Q31(0.04081179924692f), Q31(0.03812810994926f), Q31(0.05144908135699f), Q31(0.06399831151592f),
Q31(0.07428313801106f), Q31(0.08100347892914f), Q31(0.08333333333333f)
};
static const int g1_Q8[] = {
Q31(0.01565675600122f), Q31(0.03752716391991f), Q31(0.05417891378782f), Q31(0.08417044116767f),
Q31(0.10307344158036f), Q31(0.12222452249753f), Q31(0.125f)
};
static const int g2_Q4[] = {
Q31(-0.05908211155639f), Q31(-0.04871498374946f), Q31(0.0f), Q31(0.07778723915851f),
Q31( 0.16486303567403f), Q31( 0.23279856662996f), Q31(0.25f)
};
static const int sintbl_4[4] = { 0, 1073741824, 0, -1073741824 };
static const int costbl_4[4] = { 1073741824, 0, -1073741824, 0 };
static const int sintbl_8[8] = { 0, 759250125, 1073741824, 759250125,
0, -759250125, -1073741824, -759250125 };
static const int costbl_8[8] = { 1073741824, 759250125, 0, -759250125,
-1073741824, -759250125, 0, 759250125 };
static const int sintbl_12[12] = { 0, 536870912, 929887697, 1073741824,
929887697, 536870912, 0, -536870912,
-929887697, -1073741824, -929887697, -536870912 };
static const int costbl_12[12] = { 1073741824, 929887697, 536870912, 0,
-536870912, -929887697, -1073741824, -929887697,
-536870912, 0, 536870912, 929887697 };
static void make_filters_from_proto(int (*filter)[8][2], const int *proto, int bands)
{
const int *sinptr, *cosptr;
int s, c, sinhalf, coshalf;
int q, n;
if (bands == 4) {
sinptr = sintbl_4;
cosptr = costbl_4;
sinhalf = 759250125;
coshalf = 759250125;
} else if (bands == 8) {
sinptr = sintbl_8;
cosptr = costbl_8;
sinhalf = 410903207;
coshalf = 992008094;
} else {
sinptr = sintbl_12;
cosptr = costbl_12;
sinhalf = 277904834;
coshalf = 1037154959;
}
for (q = 0; q < bands; q++) {
for (n = 0; n < 7; n++) {
int theta = (q*(n-6) + (n>>1) - 3) % bands;
if (theta < 0)
theta += bands;
s = sinptr[theta];
c = cosptr[theta];
if (n & 1) {
theta = (int)(((int64_t)c * coshalf - (int64_t)s * sinhalf + 0x20000000) >> 30);
s = (int)(((int64_t)s * coshalf + (int64_t)c * sinhalf + 0x20000000) >> 30);
c = theta;
}
filter[q][n][0] = (int)(((int64_t)proto[n] * c + 0x20000000) >> 30);
filter[q][n][1] = -(int)(((int64_t)proto[n] * s + 0x20000000) >> 30);
}
}
}
static void ps_tableinit(void)
{
static const int ipdopd_sin[] = { Q30(0), Q30(M_SQRT1_2), Q30(1), Q30( M_SQRT1_2), Q30( 0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2) };
static const int ipdopd_cos[] = { Q30(1), Q30(M_SQRT1_2), Q30(0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2), Q30( 0), Q30( M_SQRT1_2) };
int pd0, pd1, pd2;
int idx;
static const int alpha_tab[] =
{
Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI),
Q30(1.4455626011f/M_PI), Q30(1.4531552792f/M_PI), Q30(1.4648091793f/M_PI), Q30(1.4945238829f/M_PI), Q30(1.5239057541f/M_PI), Q30(1.5644006729f/M_PI),
Q30(1.3738563061f/M_PI), Q30(1.3851221800f/M_PI), Q30(1.4026404619f/M_PI), Q30(1.4484288692f/M_PI), Q30(1.4949874878f/M_PI), Q30(1.5604078770f/M_PI),
Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI),
Q30(1.1507037878f/M_PI), Q30(1.1669205427f/M_PI), Q30(1.1938756704f/M_PI), Q30(1.2754167318f/M_PI), Q30(1.3761177063f/M_PI), Q30(1.5429240465f/M_PI),
Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI),
Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI),
Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI),
Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI),
Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI),
Q30(0.4200925827f/M_PI), Q30(0.4038758278f/M_PI), Q30(0.3769206405f/M_PI), Q30(0.2953795493f/M_PI), Q30(0.1946786791f/M_PI), Q30(0.0278722942f/M_PI),
Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI),
Q30(0.1969399750f/M_PI), Q30(0.1856741160f/M_PI), Q30(0.1681558639f/M_PI), Q30(0.1223674342f/M_PI), Q30(0.0758088827f/M_PI), Q30(0.0103884479f/M_PI),
Q30(0.1252337098f/M_PI), Q30(0.1176410317f/M_PI), Q30(0.1059871912f/M_PI), Q30(0.0762724727f/M_PI), Q30(0.0468905345f/M_PI), Q30(0.0063956482f/M_PI),
Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI),
Q30(1.5676341057f/M_PI), Q30(1.5678333044f/M_PI), Q30(1.5681363344f/M_PI), Q30(1.5688960552f/M_PI), Q30(1.5696337223f/M_PI), Q30(1.5706381798f/M_PI),
Q30(1.5651730299f/M_PI), Q30(1.5655272007f/M_PI), Q30(1.5660660267f/M_PI), Q30(1.5674170256f/M_PI), Q30(1.5687289238f/M_PI), Q30(1.5705151558f/M_PI),
Q30(1.5607966185f/M_PI), Q30(1.5614265203f/M_PI), Q30(1.5623844862f/M_PI), Q30(1.5647867918f/M_PI), Q30(1.5671195984f/M_PI), Q30(1.5702962875f/M_PI),
Q30(1.5530153513f/M_PI), Q30(1.5541347265f/M_PI), Q30(1.5558375120f/M_PI), Q30(1.5601085424f/M_PI), Q30(1.5642569065f/M_PI), Q30(1.5699069500f/M_PI),
Q30(1.5391840935f/M_PI), Q30(1.5411708355f/M_PI), Q30(1.5441943407f/M_PI), Q30(1.5517836809f/M_PI), Q30(1.5591609478f/M_PI), Q30(1.5692136288f/M_PI),
Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI),
Q30(1.4915299416f/M_PI), Q30(1.4964480400f/M_PI), Q30(1.5039558411f/M_PI), Q30(1.5229074955f/M_PI), Q30(1.5414420366f/M_PI), Q30(1.5667995214f/M_PI),
Q30(1.4590617418f/M_PI), Q30(1.4658898115f/M_PI), Q30(1.4763505459f/M_PI), Q30(1.5029321909f/M_PI), Q30(1.5291173458f/M_PI), Q30(1.5651149750f/M_PI),
Q30(1.4136143923f/M_PI), Q30(1.4229322672f/M_PI), Q30(1.4373078346f/M_PI), Q30(1.4743183851f/M_PI), Q30(1.5113102198f/M_PI), Q30(1.5626684427f/M_PI),
Q30(1.3505556583f/M_PI), Q30(1.3628427982f/M_PI), Q30(1.3820509911f/M_PI), Q30(1.4327841997f/M_PI), Q30(1.4850014448f/M_PI), Q30(1.5590143204f/M_PI),
Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI),
Q30(1.1919227839f/M_PI), Q30(1.2081253529f/M_PI), Q30(1.2346779108f/M_PI), Q30(1.3123005629f/M_PI), Q30(1.4034168720f/M_PI), Q30(1.5471596718f/M_PI),
Q30(1.1061993837f/M_PI), Q30(1.1219338179f/M_PI), Q30(1.1484941244f/M_PI), Q30(1.2320860624f/M_PI), Q30(1.3421301842f/M_PI), Q30(1.5373806953f/M_PI),
Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI),
Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI),
Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI),
Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI),
Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI),
Q30(0.4645969570f/M_PI), Q30(0.4488625824f/M_PI), Q30(0.4223022461f/M_PI), Q30(0.3387103081f/M_PI), Q30(0.2286661267f/M_PI), Q30(0.0334156826f/M_PI),
Q30(0.3788735867f/M_PI), Q30(0.3626709878f/M_PI), Q30(0.3361184299f/M_PI), Q30(0.2584958076f/M_PI), Q30(0.1673794836f/M_PI), Q30(0.0236366931f/M_PI),
Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI),
Q30(0.2202406377f/M_PI), Q30(0.2079535723f/M_PI), Q30(0.1887452900f/M_PI), Q30(0.1380121708f/M_PI), Q30(0.0857949182f/M_PI), Q30(0.0117820343f/M_PI),
Q30(0.1571819335f/M_PI), Q30(0.1478640437f/M_PI), Q30(0.1334884763f/M_PI), Q30(0.0964778885f/M_PI), Q30(0.0594860613f/M_PI), Q30(0.0081279324f/M_PI),
Q30(0.1117345318f/M_PI), Q30(0.1049065739f/M_PI), Q30(0.0944457650f/M_PI), Q30(0.0678641573f/M_PI), Q30(0.0416790098f/M_PI), Q30(0.0056813755f/M_PI),
Q30(0.0792663917f/M_PI), Q30(0.0743482932f/M_PI), Q30(0.0668405443f/M_PI), Q30(0.0478888862f/M_PI), Q30(0.0293543357f/M_PI), Q30(0.0039967746f/M_PI),
Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI),
Q30(0.0316122435f/M_PI), Q30(0.0296254847f/M_PI), Q30(0.0266019460f/M_PI), Q30(0.0190126132f/M_PI), Q30(0.0116353342f/M_PI), Q30(0.0015827164f/M_PI),
Q30(0.0177809205f/M_PI), Q30(0.0166615788f/M_PI), Q30(0.0149587989f/M_PI), Q30(0.0106877899f/M_PI), Q30(0.0065393616f/M_PI), Q30(0.0008894200f/M_PI),
Q30(0.0099996664f/M_PI), Q30(0.0093698399f/M_PI), Q30(0.0084118480f/M_PI), Q30(0.0060095116f/M_PI), Q30(0.0036767013f/M_PI), Q30(0.0005000498f/M_PI),
Q30(0.0056233541f/M_PI), Q30(0.0052691097f/M_PI), Q30(0.0047303112f/M_PI), Q30(0.0033792770f/M_PI), Q30(0.0020674451f/M_PI), Q30(0.0002811795f/M_PI),
Q30(0.0031622672f/M_PI), Q30(0.0029630491f/M_PI), Q30(0.0026600463f/M_PI), Q30(0.0019002859f/M_PI), Q30(0.0011625893f/M_PI), Q30(0.0001581155f/M_PI)
};
static const int gamma_tab[] =
{
Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI),
Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI)
};
static const int iid_par_dequant_c1[] = {
//iid_par_dequant_default
Q30(1.41198278375959f), Q30(1.40313815268360f), Q30(1.38687670404960f), Q30(1.34839972492648f),
Q30(1.29124937110028f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1),
Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.57677990744575f), Q30(0.42640143271122f),
Q30(0.27671828230984f), Q30(0.17664462766713f), Q30(0.07940162697653f),
//iid_par_dequant_fine
Q30(1.41420649135832f), Q30(1.41419120222364f), Q30(1.41414285699784f), Q30(1.41399000859438f),
Q30(1.41350698548044f), Q30(1.41198278375959f), Q30(1.40977302262355f), Q30(1.40539479488545f),
Q30(1.39677960498402f), Q30(1.38005309967827f), Q30(1.34839972492648f), Q30(1.31392017367631f),
Q30(1.26431008149654f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1),
Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.63365607219232f), Q30(0.52308104267543f),
Q30(0.42640143271122f), Q30(0.30895540465965f), Q30(0.22137464873077f), Q30(0.15768788954414f),
Q30(0.11198225164225f), Q30(0.07940162697653f), Q30(0.04469901562677f), Q30(0.02514469318284f),
Q30(0.01414142856998f), Q30(0.00795258154731f), Q30(0.00447211359449f),
};
static const int acos_icc_invq[] = {
Q31(0), Q31(0.178427635f/M_PI), Q31(0.28566733f/M_PI), Q31(0.46307236f/M_PI), Q31(0.59716315f/M_PI), Q31(0.78539816f/M_PI), Q31(1.10030855f/M_PI), Q31(1.57079633f/M_PI)
};
int iid, icc;
int k, m;
static const int8_t f_center_20[] = {
-3, -1, 1, 3, 5, 7, 10, 14, 18, 22,
};
static const int32_t f_center_34[] = {
Q31( 2/768.0),Q31( 6/768.0),Q31(10/768.0),Q31(14/768.0),Q31( 18/768.0),Q31( 22/768.0),Q31( 26/768.0),Q31(30/768.0),
Q31( 34/768.0),Q31(-10/768.0),Q31(-6/768.0),Q31(-2/768.0),Q31( 51/768.0),Q31( 57/768.0),Q31( 15/768.0),Q31(21/768.0),
Q31( 27/768.0),Q31( 33/768.0),Q31(39/768.0),Q31(45/768.0),Q31( 54/768.0),Q31( 66/768.0),Q31( 78/768.0),Q31(42/768.0),
Q31(102/768.0),Q31( 66/768.0),Q31(78/768.0),Q31(90/768.0),Q31(102/768.0),Q31(114/768.0),Q31(126/768.0),Q31(90/768.0)
};
static const int fractional_delay_links[] = { Q31(0.43f), Q31(0.75f), Q31(0.347f) };
const int fractional_delay_gain = Q31(0.39f);
for (pd0 = 0; pd0 < 8; pd0++) {
int pd0_re = (ipdopd_cos[pd0]+2)>>2;
int pd0_im = (ipdopd_sin[pd0]+2)>>2;
for (pd1 = 0; pd1 < 8; pd1++) {
int pd1_re = ipdopd_cos[pd1] >> 1;
int pd1_im = ipdopd_sin[pd1] >> 1;
for (pd2 = 0; pd2 < 8; pd2++) {
int shift, round;
int pd2_re = ipdopd_cos[pd2];
int pd2_im = ipdopd_sin[pd2];
int re_smooth = pd0_re + pd1_re + pd2_re;
int im_smooth = pd0_im + pd1_im + pd2_im;
SoftFloat pd_mag = av_int2sf(((ipdopd_cos[(pd0-pd1)&7]+8)>>4) + ((ipdopd_cos[(pd0-pd2)&7]+4)>>3) +
((ipdopd_cos[(pd1-pd2)&7]+2)>>2) + 0x15000000, 28);
pd_mag = av_div_sf(FLOAT_1, av_sqrt_sf(pd_mag));
shift = 30 - pd_mag.exp;
round = 1 << (shift-1);
pd_re_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)re_smooth * pd_mag.mant + round) >> shift);
pd_im_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)im_smooth * pd_mag.mant + round) >> shift);
}
}
}
idx = 0;
for (iid = 0; iid < 46; iid++) {
int c1, c2;
c1 = iid_par_dequant_c1[iid];
if (iid < 15)
c2 = iid_par_dequant_c1[14-iid];
else
c2 = iid_par_dequant_c1[60-iid];
for (icc = 0; icc < 8; icc++) {
/*if (PS_BASELINE || ps->icc_mode < 3)*/{
int alpha, beta;
int ca, sa, cb, sb;
alpha = acos_icc_invq[icc];
beta = (int)(((int64_t)alpha * 1518500250 + 0x40000000) >> 31);
alpha >>= 1;
beta = (int)(((int64_t)beta * (c1 - c2) + 0x40000000) >> 31);
av_sincos_sf(beta + alpha, &sa, &ca);
av_sincos_sf(beta - alpha, &sb, &cb);
HA[iid][icc][0] = (int)(((int64_t)c2 * ca + 0x20000000) >> 30);
HA[iid][icc][1] = (int)(((int64_t)c1 * cb + 0x20000000) >> 30);
HA[iid][icc][2] = (int)(((int64_t)c2 * sa + 0x20000000) >> 30);
HA[iid][icc][3] = (int)(((int64_t)c1 * sb + 0x20000000) >> 30);
} /* else */ {
int alpha_int, gamma_int;
int alpha_c_int, alpha_s_int, gamma_c_int, gamma_s_int;
alpha_int = alpha_tab[idx];
gamma_int = gamma_tab[idx];
av_sincos_sf(alpha_int, &alpha_s_int, &alpha_c_int);
av_sincos_sf(gamma_int, &gamma_s_int, &gamma_c_int);
alpha_c_int = (int)(((int64_t)alpha_c_int * 1518500250 + 0x20000000) >> 30);
alpha_s_int = (int)(((int64_t)alpha_s_int * 1518500250 + 0x20000000) >> 30);
HB[iid][icc][0] = (int)(((int64_t)alpha_c_int * gamma_c_int + 0x20000000) >> 30);
HB[iid][icc][1] = (int)(((int64_t)alpha_s_int * gamma_c_int + 0x20000000) >> 30);
HB[iid][icc][2] = -(int)(((int64_t)alpha_s_int * gamma_s_int + 0x20000000) >> 30);
HB[iid][icc][3] = (int)(((int64_t)alpha_c_int * gamma_s_int + 0x20000000) >> 30);
}
if (icc < 5 || icc > 6)
idx++;
}
}
for (k = 0; k < NR_ALLPASS_BANDS20; k++) {
int theta;
int64_t f_center;
int c, s;
if (k < FF_ARRAY_ELEMS(f_center_20))
f_center = f_center_20[k];
else
f_center = (k << 3) - 52;
for (m = 0; m < PS_AP_LINKS; m++) {
theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 8) >> 4);
av_sincos_sf(-theta, &s, &c);
Q_fract_allpass[0][k][m][0] = c;
Q_fract_allpass[0][k][m][1] = s;
}
theta = (int)(((int64_t)fractional_delay_gain * f_center + 8) >> 4);
av_sincos_sf(-theta, &s, &c);
phi_fract[0][k][0] = c;
phi_fract[0][k][1] = s;
}
for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
int theta, f_center;
int c, s;
if (k < FF_ARRAY_ELEMS(f_center_34))
f_center = f_center_34[k];
else
f_center = ((int64_t)k << 26) - (53 << 25);
for (m = 0; m < PS_AP_LINKS; m++) {
theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 0x10000000) >> 27);
av_sincos_sf(-theta, &s, &c);
Q_fract_allpass[1][k][m][0] = c;
Q_fract_allpass[1][k][m][1] = s;
}
theta = (int)(((int64_t)fractional_delay_gain * f_center + 0x10000000) >> 27);
av_sincos_sf(-theta, &s, &c);
phi_fract[1][k][0] = c;
phi_fract[1][k][1] = s;
}
make_filters_from_proto(f20_0_8, g0_Q8, 8);
make_filters_from_proto(f34_0_12, g0_Q12, 12);
make_filters_from_proto(f34_1_8, g1_Q8, 8);
make_filters_from_proto(f34_2_4, g2_Q4, 4);
}
#endif /* CONFIG_HARDCODED_TABLES */
#endif /* AVCODEC_AACPS_FIXED_TABLEGEN_H */

View file

@ -0,0 +1,24 @@
/*
* MPEG-4 Parametric Stereo decoding functions
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 0
#include "aacps.c"

View file

@ -0,0 +1,24 @@
/*
* Generate a header file for hardcoded Parametric Stereo tables
*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 0
#include "aacps_tablegen_template.c"

View file

@ -0,0 +1,217 @@
/*
* Header file for hardcoded Parametric Stereo tables
*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACPS_TABLEGEN_H
#define AVCODEC_AACPS_TABLEGEN_H
#include <math.h>
#include <stdint.h>
#if CONFIG_HARDCODED_TABLES
#define ps_tableinit()
#define TABLE_CONST const
#include "libavcodec/aacps_tables.h"
#else
#include "libavutil/common.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#define NR_ALLPASS_BANDS20 30
#define NR_ALLPASS_BANDS34 50
#define PS_AP_LINKS 3
#define TABLE_CONST
static float pd_re_smooth[8*8*8];
static float pd_im_smooth[8*8*8];
static float HA[46][8][4];
static float HB[46][8][4];
static DECLARE_ALIGNED(16, float, f20_0_8) [ 8][8][2];
static DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2];
static DECLARE_ALIGNED(16, float, f34_1_8) [ 8][8][2];
static DECLARE_ALIGNED(16, float, f34_2_4) [ 4][8][2];
static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2];
static DECLARE_ALIGNED(16, float, phi_fract)[2][50][2];
static const float g0_Q8[] = {
0.00746082949812f, 0.02270420949825f, 0.04546865930473f, 0.07266113929591f,
0.09885108575264f, 0.11793710567217f, 0.125f
};
static const float g0_Q12[] = {
0.04081179924692f, 0.03812810994926f, 0.05144908135699f, 0.06399831151592f,
0.07428313801106f, 0.08100347892914f, 0.08333333333333f
};
static const float g1_Q8[] = {
0.01565675600122f, 0.03752716391991f, 0.05417891378782f, 0.08417044116767f,
0.10307344158036f, 0.12222452249753f, 0.125f
};
static const float g2_Q4[] = {
-0.05908211155639f, -0.04871498374946f, 0.0f, 0.07778723915851f,
0.16486303567403f, 0.23279856662996f, 0.25f
};
static av_cold void make_filters_from_proto(float (*filter)[8][2], const float *proto, int bands)
{
int q, n;
for (q = 0; q < bands; q++) {
for (n = 0; n < 7; n++) {
double theta = 2 * M_PI * (q + 0.5) * (n - 6) / bands;
filter[q][n][0] = proto[n] * cos(theta);
filter[q][n][1] = proto[n] * -sin(theta);
}
}
}
static av_cold void ps_tableinit(void)
{
static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2 };
static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2, 0, M_SQRT1_2 };
int pd0, pd1, pd2;
static const float iid_par_dequant[] = {
//iid_par_dequant_default
0.05623413251903, 0.12589254117942, 0.19952623149689, 0.31622776601684,
0.44668359215096, 0.63095734448019, 0.79432823472428, 1,
1.25892541179417, 1.58489319246111, 2.23872113856834, 3.16227766016838,
5.01187233627272, 7.94328234724282, 17.7827941003892,
//iid_par_dequant_fine
0.00316227766017, 0.00562341325190, 0.01, 0.01778279410039,
0.03162277660168, 0.05623413251903, 0.07943282347243, 0.11220184543020,
0.15848931924611, 0.22387211385683, 0.31622776601684, 0.39810717055350,
0.50118723362727, 0.63095734448019, 0.79432823472428, 1,
1.25892541179417, 1.58489319246111, 1.99526231496888, 2.51188643150958,
3.16227766016838, 4.46683592150963, 6.30957344480193, 8.91250938133745,
12.5892541179417, 17.7827941003892, 31.6227766016838, 56.2341325190349,
100, 177.827941003892, 316.227766016837,
};
static const float icc_invq[] = {
1, 0.937, 0.84118, 0.60092, 0.36764, 0, -0.589, -1
};
static const float acos_icc_invq[] = {
0, 0.35685527, 0.57133466, 0.92614472, 1.1943263, M_PI/2, 2.2006171, M_PI
};
int iid, icc;
int k, m;
static const int8_t f_center_20[] = {
-3, -1, 1, 3, 5, 7, 10, 14, 18, 22,
};
static const int8_t f_center_34[] = {
2, 6, 10, 14, 18, 22, 26, 30,
34,-10, -6, -2, 51, 57, 15, 21,
27, 33, 39, 45, 54, 66, 78, 42,
102, 66, 78, 90,102,114,126, 90,
};
static const float fractional_delay_links[] = { 0.43f, 0.75f, 0.347f };
const float fractional_delay_gain = 0.39f;
for (pd0 = 0; pd0 < 8; pd0++) {
float pd0_re = ipdopd_cos[pd0];
float pd0_im = ipdopd_sin[pd0];
for (pd1 = 0; pd1 < 8; pd1++) {
float pd1_re = ipdopd_cos[pd1];
float pd1_im = ipdopd_sin[pd1];
for (pd2 = 0; pd2 < 8; pd2++) {
float pd2_re = ipdopd_cos[pd2];
float pd2_im = ipdopd_sin[pd2];
float re_smooth = 0.25f * pd0_re + 0.5f * pd1_re + pd2_re;
float im_smooth = 0.25f * pd0_im + 0.5f * pd1_im + pd2_im;
float pd_mag = 1 / hypot(im_smooth, re_smooth);
pd_re_smooth[pd0*64+pd1*8+pd2] = re_smooth * pd_mag;
pd_im_smooth[pd0*64+pd1*8+pd2] = im_smooth * pd_mag;
}
}
}
for (iid = 0; iid < 46; iid++) {
float c = iid_par_dequant[iid]; ///< Linear Inter-channel Intensity Difference
float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c);
float c2 = c * c1;
for (icc = 0; icc < 8; icc++) {
/*if (PS_BASELINE || ps->icc_mode < 3)*/ {
float alpha = 0.5f * acos_icc_invq[icc];
float beta = alpha * (c1 - c2) * (float)M_SQRT1_2;
HA[iid][icc][0] = c2 * cosf(beta + alpha);
HA[iid][icc][1] = c1 * cosf(beta - alpha);
HA[iid][icc][2] = c2 * sinf(beta + alpha);
HA[iid][icc][3] = c1 * sinf(beta - alpha);
} /* else */ {
float alpha, gamma, mu, rho;
float alpha_c, alpha_s, gamma_c, gamma_s;
rho = FFMAX(icc_invq[icc], 0.05f);
alpha = 0.5f * atan2f(2.0f * c * rho, c*c - 1.0f);
mu = c + 1.0f / c;
mu = sqrtf(1 + (4 * rho * rho - 4)/(mu * mu));
gamma = atanf(sqrtf((1.0f - mu)/(1.0f + mu)));
if (alpha < 0) alpha += M_PI/2;
alpha_c = cosf(alpha);
alpha_s = sinf(alpha);
gamma_c = cosf(gamma);
gamma_s = sinf(gamma);
HB[iid][icc][0] = M_SQRT2 * alpha_c * gamma_c;
HB[iid][icc][1] = M_SQRT2 * alpha_s * gamma_c;
HB[iid][icc][2] = -M_SQRT2 * alpha_s * gamma_s;
HB[iid][icc][3] = M_SQRT2 * alpha_c * gamma_s;
}
}
}
for (k = 0; k < NR_ALLPASS_BANDS20; k++) {
double f_center, theta;
if (k < FF_ARRAY_ELEMS(f_center_20))
f_center = f_center_20[k] * 0.125;
else
f_center = k - 6.5f;
for (m = 0; m < PS_AP_LINKS; m++) {
theta = -M_PI * fractional_delay_links[m] * f_center;
Q_fract_allpass[0][k][m][0] = cos(theta);
Q_fract_allpass[0][k][m][1] = sin(theta);
}
theta = -M_PI*fractional_delay_gain*f_center;
phi_fract[0][k][0] = cos(theta);
phi_fract[0][k][1] = sin(theta);
}
for (k = 0; k < NR_ALLPASS_BANDS34; k++) {
double f_center, theta;
if (k < FF_ARRAY_ELEMS(f_center_34))
f_center = f_center_34[k] / 24.0;
else
f_center = k - 26.5f;
for (m = 0; m < PS_AP_LINKS; m++) {
theta = -M_PI * fractional_delay_links[m] * f_center;
Q_fract_allpass[1][k][m][0] = cos(theta);
Q_fract_allpass[1][k][m][1] = sin(theta);
}
theta = -M_PI*fractional_delay_gain*f_center;
phi_fract[1][k][0] = cos(theta);
phi_fract[1][k][1] = sin(theta);
}
make_filters_from_proto(f20_0_8, g0_Q8, 8);
make_filters_from_proto(f34_0_12, g0_Q12, 12);
make_filters_from_proto(f34_1_8, g1_Q8, 8);
make_filters_from_proto(f34_2_4, g2_Q4, 4);
}
#endif /* CONFIG_HARDCODED_TABLES */
#endif /* AVCODEC_AACPS_TABLEGEN_H */

View file

@ -0,0 +1,107 @@
/*
* Generate a header file for hardcoded Parametric Stereo tables
*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#define CONFIG_HARDCODED_TABLES 0
#include "aac_defines.h"
#if USE_FIXED
#define TYPE_NAME "int32_t"
typedef int32_t INT32FLOAT;
#define ARRAY_RENAME(x) write_int32_t_ ## x
#define ARRAY_URENAME(x) write_uint32_t_ ## x
#include "aacps_fixed_tablegen.h"
#else
#define TYPE_NAME "float"
typedef float INT32FLOAT;
#define ARRAY_RENAME(x) write_float_ ## x
#define ARRAY_URENAME(x) write_float_ ## x
#include "aacps_tablegen.h"
#endif /* USE_FIXED */
#include "tableprint.h"
void ARRAY_RENAME(3d_array) (const void *p, int b, int c, int d)
{
int i;
const INT32FLOAT *f = p;
for (i = 0; i < b; i++) {
printf("{\n");
ARRAY_URENAME(2d_array)(f, c, d);
printf("},\n");
f += c * d;
}
}
void ARRAY_RENAME(4d_array) (const void *p, int a, int b, int c, int d)
{
int i;
const INT32FLOAT *f = p;
for (i = 0; i < a; i++) {
printf("{\n");
ARRAY_RENAME(3d_array)(f, b, c, d);
printf("},\n");
f += b * c * d;
}
}
int main(void)
{
ps_tableinit();
write_fileheader();
printf("static const %s pd_re_smooth[8*8*8] = {\n", TYPE_NAME);
ARRAY_RENAME(array)(pd_re_smooth, 8*8*8);
printf("};\n");
printf("static const %s pd_im_smooth[8*8*8] = {\n", TYPE_NAME);
ARRAY_RENAME(array)(pd_im_smooth, 8*8*8);
printf("};\n");
printf("static const %s HA[46][8][4] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(HA, 46, 8, 4);
printf("};\n");
printf("static const %s HB[46][8][4] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(HB, 46, 8, 4);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, f20_0_8)[8][8][2] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(f20_0_8, 8, 8, 2);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, f34_0_12)[12][8][2] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(f34_0_12, 12, 8, 2);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, f34_1_8)[8][8][2] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(f34_1_8, 8, 8, 2);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, f34_2_4)[4][8][2] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(f34_2_4, 4, 8, 2);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, Q_fract_allpass)[2][50][3][2] = {\n", TYPE_NAME);
ARRAY_RENAME(4d_array)(Q_fract_allpass, 2, 50, 3, 2);
printf("};\n");
printf("static const DECLARE_ALIGNED(16, %s, phi_fract)[2][50][2] = {\n", TYPE_NAME);
ARRAY_RENAME(3d_array)(phi_fract, 2, 50, 2);
printf("};\n");
return 0;
}

View file

@ -0,0 +1,163 @@
/*
* MPEG-4 Parametric Stereo data tables
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
static const uint8_t huff_iid_df1_bits[] = {
18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 18, 17, 17, 16, 16, 15, 14, 14,
13, 12, 12, 11, 10, 10, 8, 7, 6, 5, 4, 3, 1, 3, 4, 5, 6, 7,
8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 16, 17, 17, 18, 17, 18, 18,
18, 18, 18, 18, 18, 18, 18,
};
static const uint32_t huff_iid_df1_codes[] = {
0x01FEB4, 0x01FEB5, 0x01FD76, 0x01FD77, 0x01FD74, 0x01FD75, 0x01FE8A,
0x01FE8B, 0x01FE88, 0x00FE80, 0x01FEB6, 0x00FE82, 0x00FEB8, 0x007F42,
0x007FAE, 0x003FAF, 0x001FD1, 0x001FE9, 0x000FE9, 0x0007EA, 0x0007FB,
0x0003FB, 0x0001FB, 0x0001FF, 0x00007C, 0x00003C, 0x00001C, 0x00000C,
0x000000, 0x000001, 0x000001, 0x000002, 0x000001, 0x00000D, 0x00001D,
0x00003D, 0x00007D, 0x0000FC, 0x0001FC, 0x0003FC, 0x0003F4, 0x0007EB,
0x000FEA, 0x001FEA, 0x001FD6, 0x003FD0, 0x007FAF, 0x007F43, 0x00FEB9,
0x00FE83, 0x01FEB7, 0x00FE81, 0x01FE89, 0x01FE8E, 0x01FE8F, 0x01FE8C,
0x01FE8D, 0x01FEB2, 0x01FEB3, 0x01FEB0, 0x01FEB1,
};
static const uint8_t huff_iid_dt1_bits[] = {
16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 13,
13, 13, 12, 12, 11, 10, 9, 9, 7, 6, 5, 3, 1, 2, 5, 6, 7, 8,
9, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16,
};
static const uint16_t huff_iid_dt1_codes[] = {
0x004ED4, 0x004ED5, 0x004ECE, 0x004ECF, 0x004ECC, 0x004ED6, 0x004ED8,
0x004F46, 0x004F60, 0x002718, 0x002719, 0x002764, 0x002765, 0x00276D,
0x0027B1, 0x0013B7, 0x0013D6, 0x0009C7, 0x0009E9, 0x0009ED, 0x0004EE,
0x0004F7, 0x000278, 0x000139, 0x00009A, 0x00009F, 0x000020, 0x000011,
0x00000A, 0x000003, 0x000001, 0x000000, 0x00000B, 0x000012, 0x000021,
0x00004C, 0x00009B, 0x00013A, 0x000279, 0x000270, 0x0004EF, 0x0004E2,
0x0009EA, 0x0009D8, 0x0013D7, 0x0013D0, 0x0027B2, 0x0027A2, 0x00271A,
0x00271B, 0x004F66, 0x004F67, 0x004F61, 0x004F47, 0x004ED9, 0x004ED7,
0x004ECD, 0x004ED2, 0x004ED3, 0x004ED0, 0x004ED1,
};
static const uint8_t huff_iid_df0_bits[] = {
17, 17, 17, 17, 16, 15, 13, 10, 9, 7, 6, 5, 4, 3, 1, 3, 4, 5,
6, 6, 8, 11, 13, 14, 14, 15, 17, 18, 18,
};
static const uint32_t huff_iid_df0_codes[] = {
0x01FFFB, 0x01FFFC, 0x01FFFD, 0x01FFFA, 0x00FFFC, 0x007FFC, 0x001FFD,
0x0003FE, 0x0001FE, 0x00007E, 0x00003C, 0x00001D, 0x00000D, 0x000005,
0x000000, 0x000004, 0x00000C, 0x00001C, 0x00003D, 0x00003E, 0x0000FE,
0x0007FE, 0x001FFC, 0x003FFC, 0x003FFD, 0x007FFD, 0x01FFFE, 0x03FFFE,
0x03FFFF,
};
static const uint8_t huff_iid_dt0_bits[] = {
19, 19, 19, 20, 20, 20, 17, 15, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7,
9, 11, 13, 14, 17, 19, 20, 20, 20, 20, 20,
};
static const uint32_t huff_iid_dt0_codes[] = {
0x07FFF9, 0x07FFFA, 0x07FFFB, 0x0FFFF8, 0x0FFFF9, 0x0FFFFA, 0x01FFFD,
0x007FFE, 0x000FFE, 0x0003FE, 0x0000FE, 0x00003E, 0x00000E, 0x000002,
0x000000, 0x000006, 0x00001E, 0x00007E, 0x0001FE, 0x0007FE, 0x001FFE,
0x003FFE, 0x01FFFC, 0x07FFF8, 0x0FFFFB, 0x0FFFFC, 0x0FFFFD, 0x0FFFFE,
0x0FFFFF,
};
static const uint8_t huff_icc_df_bits[] = {
14, 14, 12, 10, 7, 5, 3, 1, 2, 4, 6, 8, 9, 11, 13,
};
static const uint16_t huff_icc_df_codes[] = {
0x3FFF, 0x3FFE, 0x0FFE, 0x03FE, 0x007E, 0x001E, 0x0006, 0x0000,
0x0002, 0x000E, 0x003E, 0x00FE, 0x01FE, 0x07FE, 0x1FFE,
};
static const uint8_t huff_icc_dt_bits[] = {
14, 13, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12, 14,
};
static const uint16_t huff_icc_dt_codes[] = {
0x3FFE, 0x1FFE, 0x07FE, 0x01FE, 0x007E, 0x001E, 0x0006, 0x0000,
0x0002, 0x000E, 0x003E, 0x00FE, 0x03FE, 0x0FFE, 0x3FFF,
};
static const uint8_t huff_ipd_df_bits[] = {
1, 3, 4, 4, 4, 4, 4, 4,
};
static const uint8_t huff_ipd_df_codes[] = {
0x01, 0x00, 0x06, 0x04, 0x02, 0x03, 0x05, 0x07,
};
static const uint8_t huff_ipd_dt_bits[] = {
1, 3, 4, 5, 5, 4, 4, 3,
};
static const uint8_t huff_ipd_dt_codes[] = {
0x01, 0x02, 0x02, 0x03, 0x02, 0x00, 0x03, 0x03,
};
static const uint8_t huff_opd_df_bits[] = {
1, 3, 4, 4, 5, 5, 4, 3,
};
static const uint8_t huff_opd_df_codes[] = {
0x01, 0x01, 0x06, 0x04, 0x0F, 0x0E, 0x05, 0x00,
};
static const uint8_t huff_opd_dt_bits[] = {
1, 3, 4, 5, 5, 4, 4, 3,
};
static const uint8_t huff_opd_dt_codes[] = {
0x01, 0x02, 0x01, 0x07, 0x06, 0x00, 0x02, 0x03,
};
static const int8_t huff_offset[] = {
30, 30,
14, 14,
7, 7,
0, 0,
0, 0,
};
///Table 8.48
static const int8_t k_to_i_20[] = {
1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15,
15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
};
///Table 8.49
static const int8_t k_to_i_34[] = {
0, 1, 2, 3, 4, 5, 6, 6, 7, 2, 1, 0, 10, 10, 4, 5, 6, 7, 8,
9, 10, 11, 12, 9, 14, 11, 12, 13, 14, 15, 16, 13, 16, 17, 18, 19, 20, 21,
22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29,
30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33
};
static const INTFLOAT g1_Q2[] = {
Q31(0.0f), Q31(0.01899487526049f), Q31(0.0f), Q31(-0.07293139167538f),
Q31(0.0f), Q31(0.30596630545168f), Q31(0.5f)
};

View file

@ -0,0 +1,487 @@
;******************************************************************************
;* SIMD optimized MPEG-4 Parametric Stereo decoding functions
;*
;* Copyright (C) 2015 James Almer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg 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.
;*
;* FFmpeg 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 FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
ps_p1m1p1m1: dd 0, 0x80000000, 0, 0x80000000
SECTION .text
;*************************************************************************
;void ff_ps_add_squares_<opt>(float *dst, const float (*src)[2], int n);
;*************************************************************************
%macro PS_ADD_SQUARES 1
cglobal ps_add_squares, 3, 3, %1, dst, src, n
shl nd, 3
add srcq, nq
neg nq
align 16
.loop:
movaps m0, [srcq+nq]
movaps m1, [srcq+nq+mmsize]
mulps m0, m0
mulps m1, m1
HADDPS m0, m1, m2
addps m0, [dstq]
movaps [dstq], m0
add dstq, mmsize
add nq, mmsize*2
jl .loop
REP_RET
%endmacro
INIT_XMM sse
PS_ADD_SQUARES 2
INIT_XMM sse3
PS_ADD_SQUARES 3
;*******************************************************************
;void ff_ps_mul_pair_single_sse(float (*dst)[2], float (*src0)[2],
; float *src1, int n);
;*******************************************************************
INIT_XMM sse
cglobal ps_mul_pair_single, 4, 4, 4, dst, src1, src2, n
shl nd, 3
add src1q, nq
add dstq, nq
neg nq
align 16
.loop:
movu m0, [src1q+nq]
movu m1, [src1q+nq+mmsize]
mova m2, [src2q]
mova m3, m2
unpcklps m2, m2
unpckhps m3, m3
mulps m0, m2
mulps m1, m3
mova [dstq+nq], m0
mova [dstq+nq+mmsize], m1
add src2q, mmsize
add nq, mmsize*2
jl .loop
REP_RET
;***********************************************************************
;void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2],
; float h[2][4], float h_step[2][4],
; int len);
;***********************************************************************
INIT_XMM sse3
cglobal ps_stereo_interpolate, 5, 5, 6, l, r, h, h_step, n
movaps m0, [hq]
movaps m1, [h_stepq]
unpcklps m4, m0, m0
unpckhps m0, m0
unpcklps m5, m1, m1
unpckhps m1, m1
shl nd, 3
add lq, nq
add rq, nq
neg nq
align 16
.loop:
addps m4, m5
addps m0, m1
movddup m2, [lq+nq]
movddup m3, [rq+nq]
mulps m2, m4
mulps m3, m0
addps m2, m3
movsd [lq+nq], m2
movhps [rq+nq], m2
add nq, 8
jl .loop
REP_RET
;***************************************************************************
;void ps_stereo_interpolate_ipdopd_sse3(float (*l)[2], float (*r)[2],
; float h[2][4], float h_step[2][4],
; int len);
;***************************************************************************
INIT_XMM sse3
cglobal ps_stereo_interpolate_ipdopd, 5, 5, 10, l, r, h, h_step, n
movaps m0, [hq]
movaps m1, [hq+mmsize]
%if ARCH_X86_64
movaps m8, [h_stepq]
movaps m9, [h_stepq+mmsize]
%define H_STEP0 m8
%define H_STEP1 m9
%else
%define H_STEP0 [h_stepq]
%define H_STEP1 [h_stepq+mmsize]
%endif
shl nd, 3
add lq, nq
add rq, nq
neg nq
align 16
.loop:
addps m0, H_STEP0
addps m1, H_STEP1
movddup m2, [lq+nq]
movddup m3, [rq+nq]
shufps m4, m2, m2, q2301
shufps m5, m3, m3, q2301
unpcklps m6, m0, m0
unpckhps m7, m0, m0
mulps m2, m6
mulps m3, m7
unpcklps m6, m1, m1
unpckhps m7, m1, m1
mulps m4, m6
mulps m5, m7
addps m2, m3
addsubps m2, m4
addsubps m2, m5
movsd [lq+nq], m2
movhps [rq+nq], m2
add nq, 8
jl .loop
REP_RET
;**********************************************************
;void ps_hybrid_analysis_ileave_sse(float out[2][38][64],
; float (*in)[32][2],
; int i, int len)
;**********************************************************
INIT_XMM sse
cglobal ps_hybrid_analysis_ileave, 3, 7, 5, out, in, i, len, in0, in1, tmp
movsxdifnidn iq, id
mov lend, 32 << 3
lea inq, [inq+iq*4]
mov tmpd, id
shl tmpd, 8
add outq, tmpq
mov tmpd, 64
sub tmpd, id
mov id, tmpd
test id, 1
jne .loop4
test id, 2
jne .loop8
align 16
.loop16:
mov in0q, inq
mov in1q, 38*64*4
add in1q, in0q
mov tmpd, lend
.inner_loop16:
movaps m0, [in0q]
movaps m1, [in1q]
movaps m2, [in0q+lenq]
movaps m3, [in1q+lenq]
TRANSPOSE4x4PS 0, 1, 2, 3, 4
movaps [outq], m0
movaps [outq+lenq], m1
movaps [outq+lenq*2], m2
movaps [outq+3*32*2*4], m3
lea in0q, [in0q+lenq*2]
lea in1q, [in1q+lenq*2]
add outq, mmsize
sub tmpd, mmsize
jg .inner_loop16
add inq, 16
add outq, 3*32*2*4
sub id, 4
jg .loop16
RET
align 16
.loop8:
mov in0q, inq
mov in1q, 38*64*4
add in1q, in0q
mov tmpd, lend
.inner_loop8:
movlps m0, [in0q]
movlps m1, [in1q]
movhps m0, [in0q+lenq]
movhps m1, [in1q+lenq]
SBUTTERFLYPS 0, 1, 2
SBUTTERFLYPD 0, 1, 2
movaps [outq], m0
movaps [outq+lenq], m1
lea in0q, [in0q+lenq*2]
lea in1q, [in1q+lenq*2]
add outq, mmsize
sub tmpd, mmsize
jg .inner_loop8
add inq, 8
add outq, lenq
sub id, 2
jg .loop16
RET
align 16
.loop4:
mov in0q, inq
mov in1q, 38*64*4
add in1q, in0q
mov tmpd, lend
.inner_loop4:
movss m0, [in0q]
movss m1, [in1q]
movss m2, [in0q+lenq]
movss m3, [in1q+lenq]
movlhps m0, m1
movlhps m2, m3
shufps m0, m2, q2020
movaps [outq], m0
lea in0q, [in0q+lenq*2]
lea in1q, [in1q+lenq*2]
add outq, mmsize
sub tmpd, mmsize
jg .inner_loop4
add inq, 4
sub id, 1
test id, 2
jne .loop8
cmp id, 4
jge .loop16
RET
;***********************************************************
;void ps_hybrid_synthesis_deint_sse4(float out[2][38][64],
; float (*in)[32][2],
; int i, int len)
;***********************************************************
%macro HYBRID_SYNTHESIS_DEINT 0
cglobal ps_hybrid_synthesis_deint, 3, 7, 5, out, in, i, len, out0, out1, tmp
%if cpuflag(sse4)
%define MOVH movsd
%else
%define MOVH movlps
%endif
movsxdifnidn iq, id
mov lend, 32 << 3
lea outq, [outq+iq*4]
mov tmpd, id
shl tmpd, 8
add inq, tmpq
mov tmpd, 64
sub tmpd, id
mov id, tmpd
test id, 1
jne .loop4
test id, 2
jne .loop8
align 16
.loop16:
mov out0q, outq
mov out1q, 38*64*4
add out1q, out0q
mov tmpd, lend
.inner_loop16:
movaps m0, [inq]
movaps m1, [inq+lenq]
movaps m2, [inq+lenq*2]
movaps m3, [inq+3*32*2*4]
TRANSPOSE4x4PS 0, 1, 2, 3, 4
movaps [out0q], m0
movaps [out1q], m1
movaps [out0q+lenq], m2
movaps [out1q+lenq], m3
lea out0q, [out0q+lenq*2]
lea out1q, [out1q+lenq*2]
add inq, mmsize
sub tmpd, mmsize
jg .inner_loop16
add outq, 16
add inq, 3*32*2*4
sub id, 4
jg .loop16
RET
align 16
.loop8:
mov out0q, outq
mov out1q, 38*64*4
add out1q, out0q
mov tmpd, lend
.inner_loop8:
movaps m0, [inq]
movaps m1, [inq+lenq]
SBUTTERFLYPS 0, 1, 2
SBUTTERFLYPD 0, 1, 2
MOVH [out0q], m0
MOVH [out1q], m1
movhps [out0q+lenq], m0
movhps [out1q+lenq], m1
lea out0q, [out0q+lenq*2]
lea out1q, [out1q+lenq*2]
add inq, mmsize
sub tmpd, mmsize
jg .inner_loop8
add outq, 8
add inq, lenq
sub id, 2
jg .loop16
RET
align 16
.loop4:
mov out0q, outq
mov out1q, 38*64*4
add out1q, out0q
mov tmpd, lend
.inner_loop4:
movaps m0, [inq]
movss [out0q], m0
%if cpuflag(sse4)
extractps [out1q], m0, 1
extractps [out0q+lenq], m0, 2
extractps [out1q+lenq], m0, 3
%else
movhlps m1, m0
movss [out0q+lenq], m1
shufps m0, m0, 0xb1
movss [out1q], m0
movhlps m1, m0
movss [out1q+lenq], m1
%endif
lea out0q, [out0q+lenq*2]
lea out1q, [out1q+lenq*2]
add inq, mmsize
sub tmpd, mmsize
jg .inner_loop4
add outq, 4
sub id, 1
test id, 2
jne .loop8
cmp id, 4
jge .loop16
RET
%endmacro
INIT_XMM sse
HYBRID_SYNTHESIS_DEINT
INIT_XMM sse4
HYBRID_SYNTHESIS_DEINT
;*******************************************************************
;void ff_ps_hybrid_analysis_<opt>(float (*out)[2], float (*in)[2],
; const float (*filter)[8][2],
; ptrdiff_t stride, int n);
;*******************************************************************
%macro PS_HYBRID_ANALYSIS_LOOP 3
movu %1, [inq+mmsize*%3]
movu m1, [inq+mmsize*(5-%3)+8]
%if cpuflag(sse3)
pshufd %2, %1, q2301
pshufd m4, m1, q0123
pshufd m1, m1, q1032
pshufd m2, [filterq+nq+mmsize*%3], q2301
addsubps %2, m4
addsubps %1, m1
%else
mova m2, [filterq+nq+mmsize*%3]
mova %2, %1
mova m4, m1
shufps %2, %2, q2301
shufps m4, m4, q0123
shufps m1, m1, q1032
shufps m2, m2, q2301
xorps m4, m7
xorps m1, m7
subps %2, m4
subps %1, m1
%endif
mulps %2, m2
mulps %1, m2
%if %3
addps m3, %2
addps m0, %1
%endif
%endmacro
%macro PS_HYBRID_ANALYSIS 0
cglobal ps_hybrid_analysis, 5, 5, 8, out, in, filter, stride, n
%if cpuflag(sse3)
%define MOVH movsd
%else
%define MOVH movlps
%endif
shl strideq, 3
shl nd, 6
add filterq, nq
neg nq
mova m7, [ps_p1m1p1m1]
align 16
.loop:
PS_HYBRID_ANALYSIS_LOOP m0, m3, 0
PS_HYBRID_ANALYSIS_LOOP m5, m6, 1
PS_HYBRID_ANALYSIS_LOOP m5, m6, 2
%if cpuflag(sse3)
pshufd m3, m3, q2301
xorps m0, m7
hsubps m3, m0
pshufd m1, m3, q0020
pshufd m3, m3, q0031
addps m1, m3
movsd m2, [inq+6*8]
%else
mova m1, m3
mova m2, m0
shufps m1, m1, q2301
shufps m2, m2, q2301
subps m1, m3
addps m2, m0
unpcklps m3, m1, m2
unpckhps m1, m2
addps m1, m3
movu m2, [inq+6*8] ; faster than movlps and no risk of overread
%endif
movss m3, [filterq+nq+8*6]
SPLATD m3
mulps m2, m3
addps m1, m2
MOVH [outq], m1
add outq, strideq
add nq, 64
jl .loop
REP_RET
%endmacro
INIT_XMM sse
PS_HYBRID_ANALYSIS
INIT_XMM sse3
PS_HYBRID_ANALYSIS

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2012 Mans Rullgard
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACPSDSP_H
#define AVCODEC_AACPSDSP_H
#include <stddef.h>
#include "aac_defines.h"
#define PS_QMF_TIME_SLOTS 32
#define PS_AP_LINKS 3
#define PS_MAX_AP_DELAY 5
typedef struct PSDSPContext {
void (*add_squares)(INTFLOAT *dst, const INTFLOAT (*src)[2], int n);
void (*mul_pair_single)(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
int n);
void (*hybrid_analysis)(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
const INTFLOAT (*filter)[8][2],
ptrdiff_t stride, int n);
void (*hybrid_analysis_ileave)(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
int i, int len);
void (*hybrid_synthesis_deint)(INTFLOAT out[2][38][64], INTFLOAT (*in)[32][2],
int i, int len);
void (*decorrelate)(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2],
const INTFLOAT *transient_gain,
INTFLOAT g_decay_slope,
int len);
void (*stereo_interpolate[2])(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
INTFLOAT h[2][4], INTFLOAT h_step[2][4],
int len);
} PSDSPContext;
void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s);
void ff_psdsp_init_arm(PSDSPContext *s);
void ff_psdsp_init_aarch64(PSDSPContext *s);
void ff_psdsp_init_mips(PSDSPContext *s);
void ff_psdsp_init_x86(PSDSPContext *s);
#endif /* AVCODEC_AACPSDSP_H */

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 1
#include "aacpsdsp_template.c"

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define USE_FIXED 0
#include "aacpsdsp_template.c"

View file

@ -0,0 +1,72 @@
/*
* SIMD optimized MPEG-4 Parametric Stereo decoding functions
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stddef.h>
#include "config.h"
#include "libavutil/x86/cpu.h"
#include "libavutil/attributes.h"
#include "libavcodec/aacpsdsp.h"
void ff_ps_add_squares_sse (float *dst, const float (*src)[2], int n);
void ff_ps_add_squares_sse3 (float *dst, const float (*src)[2], int n);
void ff_ps_mul_pair_single_sse (float (*dst)[2], float (*src0)[2],
float *src1, int n);
void ff_ps_hybrid_analysis_sse (float (*out)[2], float (*in)[2],
const float (*filter)[8][2],
ptrdiff_t stride, int n);
void ff_ps_hybrid_analysis_sse3(float (*out)[2], float (*in)[2],
const float (*filter)[8][2],
ptrdiff_t stride, int n);
void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2],
float h[2][4], float h_step[2][4],
int len);
void ff_ps_stereo_interpolate_ipdopd_sse3(float (*l)[2], float (*r)[2],
float h[2][4], float h_step[2][4],
int len);
void ff_ps_hybrid_synthesis_deint_sse(float out[2][38][64], float (*in)[32][2],
int i, int len);
void ff_ps_hybrid_synthesis_deint_sse4(float out[2][38][64], float (*in)[32][2],
int i, int len);
void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64],
int i, int len);
av_cold void ff_psdsp_init_x86(PSDSPContext *s)
{
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_SSE(cpu_flags)) {
s->add_squares = ff_ps_add_squares_sse;
s->mul_pair_single = ff_ps_mul_pair_single_sse;
s->hybrid_analysis_ileave = ff_ps_hybrid_analysis_ileave_sse;
s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_sse;
s->hybrid_analysis = ff_ps_hybrid_analysis_sse;
}
if (EXTERNAL_SSE3(cpu_flags)) {
s->add_squares = ff_ps_add_squares_sse3;
s->stereo_interpolate[0] = ff_ps_stereo_interpolate_sse3;
s->stereo_interpolate[1] = ff_ps_stereo_interpolate_ipdopd_sse3;
s->hybrid_analysis = ff_ps_hybrid_analysis_sse3;
}
if (EXTERNAL_SSE4(cpu_flags)) {
s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_sse4;
}
}

View file

@ -0,0 +1,233 @@
/*
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Note: Rounding-to-nearest used unless otherwise stated
*
*/
#include <stdint.h>
#include "config.h"
#include "libavutil/attributes.h"
#include "aacpsdsp.h"
static void ps_add_squares_c(INTFLOAT *dst, const INTFLOAT (*src)[2], int n)
{
int i;
for (i = 0; i < n; i++)
dst[i] += (UINTFLOAT)AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
}
static void ps_mul_pair_single_c(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1,
int n)
{
int i;
for (i = 0; i < n; i++) {
dst[i][0] = AAC_MUL16(src0[i][0], src1[i]);
dst[i][1] = AAC_MUL16(src0[i][1], src1[i]);
}
}
static void ps_hybrid_analysis_c(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
const INTFLOAT (*filter)[8][2],
ptrdiff_t stride, int n)
{
int i, j;
for (i = 0; i < n; i++) {
INT64FLOAT sum_re = (INT64FLOAT)filter[i][6][0] * in[6][0];
INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];
for (j = 0; j < 6; j++) {
INT64FLOAT in0_re = in[j][0];
INT64FLOAT in0_im = in[j][1];
INT64FLOAT in1_re = in[12-j][0];
INT64FLOAT in1_im = in[12-j][1];
sum_re += (INT64FLOAT)filter[i][j][0] * (in0_re + in1_re) -
(INT64FLOAT)filter[i][j][1] * (in0_im - in1_im);
sum_im += (INT64FLOAT)filter[i][j][0] * (in0_im + in1_im) +
(INT64FLOAT)filter[i][j][1] * (in0_re - in1_re);
}
#if USE_FIXED
out[i * stride][0] = (int)((sum_re + 0x40000000) >> 31);
out[i * stride][1] = (int)((sum_im + 0x40000000) >> 31);
#else
out[i * stride][0] = sum_re;
out[i * stride][1] = sum_im;
#endif /* USE_FIXED */
}
}
static void ps_hybrid_analysis_ileave_c(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64],
int i, int len)
{
int j;
for (; i < 64; i++) {
for (j = 0; j < len; j++) {
out[i][j][0] = L[0][j][i];
out[i][j][1] = L[1][j][i];
}
}
}
static void ps_hybrid_synthesis_deint_c(INTFLOAT out[2][38][64],
INTFLOAT (*in)[32][2],
int i, int len)
{
int n;
for (; i < 64; i++) {
for (n = 0; n < len; n++) {
out[0][n][i] = in[i][n][0];
out[1][n][i] = in[i][n][1];
}
}
}
static void ps_decorrelate_c(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2],
const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2],
const INTFLOAT *transient_gain,
INTFLOAT g_decay_slope,
int len)
{
static const INTFLOAT a[] = { Q31(0.65143905753106f),
Q31(0.56471812200776f),
Q31(0.48954165955695f) };
INTFLOAT ag[PS_AP_LINKS];
int m, n;
for (m = 0; m < PS_AP_LINKS; m++)
ag[m] = AAC_MUL30(a[m], g_decay_slope);
for (n = 0; n < len; n++) {
INTFLOAT in_re = AAC_MSUB30(delay[n][0], phi_fract[0], delay[n][1], phi_fract[1]);
INTFLOAT in_im = AAC_MADD30(delay[n][0], phi_fract[1], delay[n][1], phi_fract[0]);
for (m = 0; m < PS_AP_LINKS; m++) {
INTFLOAT a_re = AAC_MUL31(ag[m], in_re);
INTFLOAT a_im = AAC_MUL31(ag[m], in_im);
INTFLOAT link_delay_re = ap_delay[m][n+2-m][0];
INTFLOAT link_delay_im = ap_delay[m][n+2-m][1];
INTFLOAT fractional_delay_re = Q_fract[m][0];
INTFLOAT fractional_delay_im = Q_fract[m][1];
INTFLOAT apd_re = in_re;
INTFLOAT apd_im = in_im;
in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
link_delay_im, fractional_delay_im);
in_re -= (UINTFLOAT)a_re;
in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
link_delay_im, fractional_delay_re);
in_im -= (UINTFLOAT)a_im;
ap_delay[m][n+5][0] = apd_re + (UINTFLOAT)AAC_MUL31(ag[m], in_re);
ap_delay[m][n+5][1] = apd_im + (UINTFLOAT)AAC_MUL31(ag[m], in_im);
}
out[n][0] = AAC_MUL16(transient_gain[n], in_re);
out[n][1] = AAC_MUL16(transient_gain[n], in_im);
}
}
static void ps_stereo_interpolate_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
INTFLOAT h[2][4], INTFLOAT h_step[2][4],
int len)
{
INTFLOAT h0 = h[0][0];
INTFLOAT h1 = h[0][1];
INTFLOAT h2 = h[0][2];
INTFLOAT h3 = h[0][3];
UINTFLOAT hs0 = h_step[0][0];
UINTFLOAT hs1 = h_step[0][1];
UINTFLOAT hs2 = h_step[0][2];
UINTFLOAT hs3 = h_step[0][3];
int n;
for (n = 0; n < len; n++) {
//l is s, r is d
INTFLOAT l_re = l[n][0];
INTFLOAT l_im = l[n][1];
INTFLOAT r_re = r[n][0];
INTFLOAT r_im = r[n][1];
h0 += hs0;
h1 += hs1;
h2 += hs2;
h3 += hs3;
l[n][0] = AAC_MADD30(h0, l_re, h2, r_re);
l[n][1] = AAC_MADD30(h0, l_im, h2, r_im);
r[n][0] = AAC_MADD30(h1, l_re, h3, r_re);
r[n][1] = AAC_MADD30(h1, l_im, h3, r_im);
}
}
static void ps_stereo_interpolate_ipdopd_c(INTFLOAT (*l)[2], INTFLOAT (*r)[2],
INTFLOAT h[2][4], INTFLOAT h_step[2][4],
int len)
{
INTFLOAT h00 = h[0][0], h10 = h[1][0];
INTFLOAT h01 = h[0][1], h11 = h[1][1];
INTFLOAT h02 = h[0][2], h12 = h[1][2];
INTFLOAT h03 = h[0][3], h13 = h[1][3];
UINTFLOAT hs00 = h_step[0][0], hs10 = h_step[1][0];
UINTFLOAT hs01 = h_step[0][1], hs11 = h_step[1][1];
UINTFLOAT hs02 = h_step[0][2], hs12 = h_step[1][2];
UINTFLOAT hs03 = h_step[0][3], hs13 = h_step[1][3];
int n;
for (n = 0; n < len; n++) {
//l is s, r is d
INTFLOAT l_re = l[n][0];
INTFLOAT l_im = l[n][1];
INTFLOAT r_re = r[n][0];
INTFLOAT r_im = r[n][1];
h00 += hs00;
h01 += hs01;
h02 += hs02;
h03 += hs03;
h10 += hs10;
h11 += hs11;
h12 += hs12;
h13 += hs13;
l[n][0] = AAC_MSUB30_V8(h00, l_re, h02, r_re, h10, l_im, h12, r_im);
l[n][1] = AAC_MADD30_V8(h00, l_im, h02, r_im, h10, l_re, h12, r_re);
r[n][0] = AAC_MSUB30_V8(h01, l_re, h03, r_re, h11, l_im, h13, r_im);
r[n][1] = AAC_MADD30_V8(h01, l_im, h03, r_im, h11, l_re, h13, r_re);
}
}
av_cold void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s)
{
s->add_squares = ps_add_squares_c;
s->mul_pair_single = ps_mul_pair_single_c;
s->hybrid_analysis = ps_hybrid_analysis_c;
s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_c;
s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_c;
s->decorrelate = ps_decorrelate_c;
s->stereo_interpolate[0] = ps_stereo_interpolate_c;
s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c;
#if !USE_FIXED
if (ARCH_ARM)
ff_psdsp_init_arm(s);
if (ARCH_AARCH64)
ff_psdsp_init_aarch64(s);
if (ARCH_MIPS)
ff_psdsp_init_mips(s);
if (ARCH_X86)
ff_psdsp_init_x86(s);
#endif /* !USE_FIXED */
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,370 @@
/*
* AAC Spectral Band Replication decoding functions
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
* Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC Spectral Band Replication decoding functions
* @author Robert Swain ( rob opendot cl )
*/
#define USE_FIXED 0
#include "aac.h"
#include "sbr.h"
#include "aacsbr.h"
#include "aacsbrdata.h"
#include "aacsbr_tablegen.h"
#include "fft.h"
#include "internal.h"
#include "aacps.h"
#include "sbrdsp.h"
#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"
#include <stdint.h>
#include <float.h>
#include <math.h>
#if ARCH_MIPS
#include "mips/aacsbr_mips.h"
#endif /* ARCH_MIPS */
static VLC vlc_sbr[10];
static void aacsbr_func_ptr_init(AACSBRContext *c);
static void make_bands(int16_t* bands, int start, int stop, int num_bands)
{
int k, previous, present;
float base, prod;
base = powf((float)stop / start, 1.0f / num_bands);
prod = start;
previous = start;
for (k = 0; k < num_bands-1; k++) {
prod *= base;
present = lrintf(prod);
bands[k] = present - previous;
previous = present;
}
bands[num_bands-1] = stop - previous;
}
/// Dequantization and stereo decoding (14496-3 sp04 p203)
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
{
int k, e;
int ch;
static const double exp2_tab[2] = {1, M_SQRT2};
if (id_aac == TYPE_CPE && sbr->bs_coupling) {
int pan_offset = sbr->data[0].bs_amp_res ? 12 : 24;
for (e = 1; e <= sbr->data[0].bs_num_env; e++) {
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
float temp1, temp2, fac;
if (sbr->data[0].bs_amp_res) {
temp1 = ff_exp2fi(sbr->data[0].env_facs_q[e][k] + 7);
temp2 = ff_exp2fi(pan_offset - sbr->data[1].env_facs_q[e][k]);
}
else {
temp1 = ff_exp2fi((sbr->data[0].env_facs_q[e][k]>>1) + 7) *
exp2_tab[sbr->data[0].env_facs_q[e][k] & 1];
temp2 = ff_exp2fi((pan_offset - sbr->data[1].env_facs_q[e][k])>>1) *
exp2_tab[(pan_offset - sbr->data[1].env_facs_q[e][k]) & 1];
}
if (temp1 > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = 1;
}
fac = temp1 / (1.0f + temp2);
sbr->data[0].env_facs[e][k] = fac;
sbr->data[1].env_facs[e][k] = fac * temp2;
}
}
for (e = 1; e <= sbr->data[0].bs_num_noise; e++) {
for (k = 0; k < sbr->n_q; k++) {
float temp1 = ff_exp2fi(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs_q[e][k] + 1);
float temp2 = ff_exp2fi(12 - sbr->data[1].noise_facs_q[e][k]);
float fac;
av_assert0(temp1 <= 1E20);
fac = temp1 / (1.0f + temp2);
sbr->data[0].noise_facs[e][k] = fac;
sbr->data[1].noise_facs[e][k] = fac * temp2;
}
}
} else { // SCE or one non-coupled CPE
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
if (sbr->data[ch].bs_amp_res)
sbr->data[ch].env_facs[e][k] = ff_exp2fi(sbr->data[ch].env_facs_q[e][k] + 6);
else
sbr->data[ch].env_facs[e][k] = ff_exp2fi((sbr->data[ch].env_facs_q[e][k]>>1) + 6)
* exp2_tab[sbr->data[ch].env_facs_q[e][k] & 1];
if (sbr->data[ch].env_facs[e][k] > 1E20) {
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
sbr->data[ch].env_facs[e][k] = 1;
}
}
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
for (k = 0; k < sbr->n_q; k++)
sbr->data[ch].noise_facs[e][k] =
ff_exp2fi(NOISE_FLOOR_OFFSET - sbr->data[ch].noise_facs_q[e][k]);
}
}
}
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
* (14496-3 sp04 p214)
* Warning: This routine does not seem numerically stable.
*/
static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
float (*alpha0)[2], float (*alpha1)[2],
const float X_low[32][40][2], int k0)
{
int k;
for (k = 0; k < k0; k++) {
LOCAL_ALIGNED_16(float, phi, [3], [2][2]);
float dk;
dsp->autocorrelate(X_low[k], phi);
dk = phi[2][1][0] * phi[1][0][0] -
(phi[1][1][0] * phi[1][1][0] + phi[1][1][1] * phi[1][1][1]) / 1.000001f;
if (!dk) {
alpha1[k][0] = 0;
alpha1[k][1] = 0;
} else {
float temp_real, temp_im;
temp_real = phi[0][0][0] * phi[1][1][0] -
phi[0][0][1] * phi[1][1][1] -
phi[0][1][0] * phi[1][0][0];
temp_im = phi[0][0][0] * phi[1][1][1] +
phi[0][0][1] * phi[1][1][0] -
phi[0][1][1] * phi[1][0][0];
alpha1[k][0] = temp_real / dk;
alpha1[k][1] = temp_im / dk;
}
if (!phi[1][0][0]) {
alpha0[k][0] = 0;
alpha0[k][1] = 0;
} else {
float temp_real, temp_im;
temp_real = phi[0][0][0] + alpha1[k][0] * phi[1][1][0] +
alpha1[k][1] * phi[1][1][1];
temp_im = phi[0][0][1] + alpha1[k][1] * phi[1][1][0] -
alpha1[k][0] * phi[1][1][1];
alpha0[k][0] = -temp_real / phi[1][0][0];
alpha0[k][1] = -temp_im / phi[1][0][0];
}
if (alpha1[k][0] * alpha1[k][0] + alpha1[k][1] * alpha1[k][1] >= 16.0f ||
alpha0[k][0] * alpha0[k][0] + alpha0[k][1] * alpha0[k][1] >= 16.0f) {
alpha1[k][0] = 0;
alpha1[k][1] = 0;
alpha0[k][0] = 0;
alpha0[k][1] = 0;
}
}
}
/// Chirp Factors (14496-3 sp04 p214)
static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data)
{
int i;
float new_bw;
static const float bw_tab[] = { 0.0f, 0.75f, 0.9f, 0.98f };
for (i = 0; i < sbr->n_q; i++) {
if (ch_data->bs_invf_mode[0][i] + ch_data->bs_invf_mode[1][i] == 1) {
new_bw = 0.6f;
} else
new_bw = bw_tab[ch_data->bs_invf_mode[0][i]];
if (new_bw < ch_data->bw_array[i]) {
new_bw = 0.75f * new_bw + 0.25f * ch_data->bw_array[i];
} else
new_bw = 0.90625f * new_bw + 0.09375f * ch_data->bw_array[i];
ch_data->bw_array[i] = new_bw < 0.015625f ? 0.0f : new_bw;
}
}
/**
* Calculation of levels of additional HF signal components (14496-3 sp04 p219)
* and Calculation of gain (14496-3 sp04 p219)
*/
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
SBRData *ch_data, const int e_a[2])
{
int e, k, m;
// max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off)
static const float limgain[4] = { 0.70795, 1.0, 1.41254, 10000000000 };
for (e = 0; e < ch_data->bs_num_env; e++) {
int delta = !((e == e_a[1]) || (e == e_a[0]));
for (k = 0; k < sbr->n_lim; k++) {
float gain_boost, gain_max;
float sum[2] = { 0.0f, 0.0f };
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
const float temp = sbr->e_origmapped[e][m] / (1.0f + sbr->q_mapped[e][m]);
sbr->q_m[e][m] = sqrtf(temp * sbr->q_mapped[e][m]);
sbr->s_m[e][m] = sqrtf(temp * ch_data->s_indexmapped[e + 1][m]);
if (!sbr->s_mapped[e][m]) {
sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] /
((1.0f + sbr->e_curr[e][m]) *
(1.0f + sbr->q_mapped[e][m] * delta)));
} else {
sbr->gain[e][m] = sqrtf(sbr->e_origmapped[e][m] * sbr->q_mapped[e][m] /
((1.0f + sbr->e_curr[e][m]) *
(1.0f + sbr->q_mapped[e][m])));
}
sbr->gain[e][m] += FLT_MIN;
}
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sum[0] += sbr->e_origmapped[e][m];
sum[1] += sbr->e_curr[e][m];
}
gain_max = limgain[sbr->bs_limiter_gains] * sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1]));
gain_max = FFMIN(100000.f, gain_max);
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
float q_m_max = sbr->q_m[e][m] * gain_max / sbr->gain[e][m];
sbr->q_m[e][m] = FFMIN(sbr->q_m[e][m], q_m_max);
sbr->gain[e][m] = FFMIN(sbr->gain[e][m], gain_max);
}
sum[0] = sum[1] = 0.0f;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sum[0] += sbr->e_origmapped[e][m];
sum[1] += sbr->e_curr[e][m] * sbr->gain[e][m] * sbr->gain[e][m]
+ sbr->s_m[e][m] * sbr->s_m[e][m]
+ (delta && !sbr->s_m[e][m]) * sbr->q_m[e][m] * sbr->q_m[e][m];
}
gain_boost = sqrtf((FLT_EPSILON + sum[0]) / (FLT_EPSILON + sum[1]));
gain_boost = FFMIN(1.584893192f, gain_boost);
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sbr->gain[e][m] *= gain_boost;
sbr->q_m[e][m] *= gain_boost;
sbr->s_m[e][m] *= gain_boost;
}
}
}
}
/// Assembling HF Signals (14496-3 sp04 p220)
static void sbr_hf_assemble(float Y1[38][64][2],
const float X_high[64][40][2],
SpectralBandReplication *sbr, SBRData *ch_data,
const int e_a[2])
{
int e, i, j, m;
const int h_SL = 4 * !sbr->bs_smoothing_mode;
const int kx = sbr->kx[1];
const int m_max = sbr->m[1];
static const float h_smooth[5] = {
0.33333333333333,
0.30150283239582,
0.21816949906249,
0.11516383427084,
0.03183050093751,
};
float (*g_temp)[48] = ch_data->g_temp, (*q_temp)[48] = ch_data->q_temp;
int indexnoise = ch_data->f_indexnoise;
int indexsine = ch_data->f_indexsine;
if (sbr->reset) {
for (i = 0; i < h_SL; i++) {
memcpy(g_temp[i + 2*ch_data->t_env[0]], sbr->gain[0], m_max * sizeof(sbr->gain[0][0]));
memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0], m_max * sizeof(sbr->q_m[0][0]));
}
} else if (h_SL) {
for (i = 0; i < 4; i++) {
memcpy(g_temp[i + 2 * ch_data->t_env[0]],
g_temp[i + 2 * ch_data->t_env_num_env_old],
sizeof(g_temp[0]));
memcpy(q_temp[i + 2 * ch_data->t_env[0]],
q_temp[i + 2 * ch_data->t_env_num_env_old],
sizeof(q_temp[0]));
}
}
for (e = 0; e < ch_data->bs_num_env; e++) {
for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
memcpy(g_temp[h_SL + i], sbr->gain[e], m_max * sizeof(sbr->gain[0][0]));
memcpy(q_temp[h_SL + i], sbr->q_m[e], m_max * sizeof(sbr->q_m[0][0]));
}
}
for (e = 0; e < ch_data->bs_num_env; e++) {
for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
LOCAL_ALIGNED_16(float, g_filt_tab, [48]);
LOCAL_ALIGNED_16(float, q_filt_tab, [48]);
float *g_filt, *q_filt;
if (h_SL && e != e_a[0] && e != e_a[1]) {
g_filt = g_filt_tab;
q_filt = q_filt_tab;
for (m = 0; m < m_max; m++) {
const int idx1 = i + h_SL;
g_filt[m] = 0.0f;
q_filt[m] = 0.0f;
for (j = 0; j <= h_SL; j++) {
g_filt[m] += g_temp[idx1 - j][m] * h_smooth[j];
q_filt[m] += q_temp[idx1 - j][m] * h_smooth[j];
}
}
} else {
g_filt = g_temp[i + h_SL];
q_filt = q_temp[i];
}
sbr->dsp.hf_g_filt(Y1[i] + kx, X_high + kx, g_filt, m_max,
i + ENVELOPE_ADJUSTMENT_OFFSET);
if (e != e_a[0] && e != e_a[1]) {
sbr->dsp.hf_apply_noise[indexsine](Y1[i] + kx, sbr->s_m[e],
q_filt, indexnoise,
kx, m_max);
} else {
int idx = indexsine&1;
int A = (1-((indexsine+(kx & 1))&2));
int B = (A^(-idx)) + idx;
float *out = &Y1[i][kx][idx];
float *in = sbr->s_m[e];
for (m = 0; m+1 < m_max; m+=2) {
out[2*m ] += in[m ] * A;
out[2*m+2] += in[m+1] * B;
}
if(m_max&1)
out[2*m ] += in[m ] * A;
}
indexnoise = (indexnoise + m_max) & 0x1ff;
indexsine = (indexsine + 1) & 3;
}
}
ch_data->f_indexnoise = indexnoise;
ch_data->f_indexsine = indexsine;
}
#include "aacsbr_template.c"

View file

@ -0,0 +1,96 @@
/*
* AAC Spectral Band Replication function declarations
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
* Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC Spectral Band Replication function declarations
* @author Robert Swain ( rob opendot cl )
*/
#ifndef AVCODEC_AACSBR_H
#define AVCODEC_AACSBR_H
#include "get_bits.h"
#include "aac.h"
#include "sbr.h"
#define ENVELOPE_ADJUSTMENT_OFFSET 2
#define NOISE_FLOOR_OFFSET 6
/**
* SBR VLC tables
*/
enum {
T_HUFFMAN_ENV_1_5DB,
F_HUFFMAN_ENV_1_5DB,
T_HUFFMAN_ENV_BAL_1_5DB,
F_HUFFMAN_ENV_BAL_1_5DB,
T_HUFFMAN_ENV_3_0DB,
F_HUFFMAN_ENV_3_0DB,
T_HUFFMAN_ENV_BAL_3_0DB,
F_HUFFMAN_ENV_BAL_3_0DB,
T_HUFFMAN_NOISE_3_0DB,
T_HUFFMAN_NOISE_BAL_3_0DB,
};
/**
* bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
*/
enum {
FIXFIX,
FIXVAR,
VARFIX,
VARVAR,
};
enum {
EXTENSION_ID_PS = 2,
};
static const int8_t vlc_sbr_lav[10] =
{ 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 };
#define SBR_INIT_VLC_STATIC(num, size) \
INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \
sbr_tmp[num].sbr_bits , 1, 1, \
sbr_tmp[num].sbr_codes, sbr_tmp[num].elem_size, sbr_tmp[num].elem_size, \
size)
#define SBR_VLC_ROW(name) \
{ name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
/** Initialize SBR. */
void AAC_RENAME(ff_aac_sbr_init)(void);
/** Initialize one SBR context. */
void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac);
/** Close one SBR context. */
void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr);
/** Decode one SBR element. */
int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, SpectralBandReplication *sbr,
GetBitContext *gb, int crc, int cnt, int id_aac);
/** Apply one SBR element to one AAC element. */
void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
INTFLOAT* L, INTFLOAT *R);
void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c);
#endif /* AVCODEC_AACSBR_H */

View file

@ -0,0 +1,613 @@
/*
* Copyright (c) 2013
* MIPS Technologies, Inc., California.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* AAC Spectral Band Replication decoding functions (fixed-point)
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
* Copyright (c) 2009-2010 Alex Converse <alex.converse@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC Spectral Band Replication decoding functions (fixed-point)
* Note: Rounding-to-nearest used unless otherwise stated
* @author Robert Swain ( rob opendot cl )
* @author Stanislav Ocovaj ( stanislav.ocovaj imgtec com )
*/
#define USE_FIXED 1
#include "aac.h"
#include "sbr.h"
#include "aacsbr.h"
#include "aacsbrdata.h"
#include "aacsbr_fixed_tablegen.h"
#include "fft.h"
#include "aacps.h"
#include "sbrdsp.h"
#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "libavutil/avassert.h"
#include <stdint.h>
#include <float.h>
#include <math.h>
static VLC vlc_sbr[10];
static void aacsbr_func_ptr_init(AACSBRContext *c);
static const int CONST_LN2 = Q31(0.6931471806/256); // ln(2)/256
static const int CONST_RECIP_LN2 = Q31(0.7213475204); // 0.5/ln(2)
static const int CONST_076923 = Q31(0.76923076923076923077f);
static const int fixed_log_table[10] =
{
Q31(1.0/2), Q31(1.0/3), Q31(1.0/4), Q31(1.0/5), Q31(1.0/6),
Q31(1.0/7), Q31(1.0/8), Q31(1.0/9), Q31(1.0/10), Q31(1.0/11)
};
static int fixed_log(int x)
{
int i, ret, xpow, tmp;
ret = x;
xpow = x;
for (i=0; i<10; i+=2){
xpow = (int)(((int64_t)xpow * x + 0x40000000) >> 31);
tmp = (int)(((int64_t)xpow * fixed_log_table[i] + 0x40000000) >> 31);
ret -= tmp;
xpow = (int)(((int64_t)xpow * x + 0x40000000) >> 31);
tmp = (int)(((int64_t)xpow * fixed_log_table[i+1] + 0x40000000) >> 31);
ret += tmp;
}
return ret;
}
static const int fixed_exp_table[7] =
{
Q31(1.0/2), Q31(1.0/6), Q31(1.0/24), Q31(1.0/120),
Q31(1.0/720), Q31(1.0/5040), Q31(1.0/40320)
};
static int fixed_exp(int x)
{
int i, ret, xpow, tmp;
ret = 0x800000 + x;
xpow = x;
for (i=0; i<7; i++){
xpow = (int)(((int64_t)xpow * x + 0x400000) >> 23);
tmp = (int)(((int64_t)xpow * fixed_exp_table[i] + 0x40000000) >> 31);
ret += tmp;
}
return ret;
}
static void make_bands(int16_t* bands, int start, int stop, int num_bands)
{
int k, previous, present;
int base, prod, nz = 0;
base = (stop << 23) / start;
while (base < 0x40000000){
base <<= 1;
nz++;
}
base = fixed_log(base - 0x80000000);
base = (((base + 0x80) >> 8) + (8-nz)*CONST_LN2) / num_bands;
base = fixed_exp(base);
previous = start;
prod = start << 23;
for (k = 0; k < num_bands-1; k++) {
prod = (int)(((int64_t)prod * base + 0x400000) >> 23);
present = (prod + 0x400000) >> 23;
bands[k] = present - previous;
previous = present;
}
bands[num_bands-1] = stop - previous;
}
/// Dequantization and stereo decoding (14496-3 sp04 p203)
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
{
int k, e;
int ch;
if (id_aac == TYPE_CPE && sbr->bs_coupling) {
int alpha = sbr->data[0].bs_amp_res ? 2 : 1;
int pan_offset = sbr->data[0].bs_amp_res ? 12 : 24;
for (e = 1; e <= sbr->data[0].bs_num_env; e++) {
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
SoftFloat temp1, temp2, fac;
temp1.exp = sbr->data[0].env_facs_q[e][k] * alpha + 14;
if (temp1.exp & 1)
temp1.mant = 759250125;
else
temp1.mant = 0x20000000;
temp1.exp = (temp1.exp >> 1) + 1;
if (temp1.exp > 66) { // temp1 > 1E20
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = FLOAT_1;
}
temp2.exp = (pan_offset - sbr->data[1].env_facs_q[e][k]) * alpha;
if (temp2.exp & 1)
temp2.mant = 759250125;
else
temp2.mant = 0x20000000;
temp2.exp = (temp2.exp >> 1) + 1;
fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
sbr->data[0].env_facs[e][k] = fac;
sbr->data[1].env_facs[e][k] = av_mul_sf(fac, temp2);
}
}
for (e = 1; e <= sbr->data[0].bs_num_noise; e++) {
for (k = 0; k < sbr->n_q; k++) {
SoftFloat temp1, temp2, fac;
temp1.exp = NOISE_FLOOR_OFFSET - \
sbr->data[0].noise_facs_q[e][k] + 2;
temp1.mant = 0x20000000;
av_assert0(temp1.exp <= 66);
temp2.exp = 12 - sbr->data[1].noise_facs_q[e][k] + 1;
temp2.mant = 0x20000000;
fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
sbr->data[0].noise_facs[e][k] = fac;
sbr->data[1].noise_facs[e][k] = av_mul_sf(fac, temp2);
}
}
} else { // SCE or one non-coupled CPE
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
int alpha = sbr->data[ch].bs_amp_res ? 2 : 1;
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
SoftFloat temp1;
temp1.exp = alpha * sbr->data[ch].env_facs_q[e][k] + 12;
if (temp1.exp & 1)
temp1.mant = 759250125;
else
temp1.mant = 0x20000000;
temp1.exp = (temp1.exp >> 1) + 1;
if (temp1.exp > 66) { // temp1 > 1E20
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = FLOAT_1;
}
sbr->data[ch].env_facs[e][k] = temp1;
}
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
for (k = 0; k < sbr->n_q; k++){
sbr->data[ch].noise_facs[e][k].exp = NOISE_FLOOR_OFFSET - \
sbr->data[ch].noise_facs_q[e][k] + 1;
sbr->data[ch].noise_facs[e][k].mant = 0x20000000;
}
}
}
}
/** High Frequency Generation (14496-3 sp04 p214+) and Inverse Filtering
* (14496-3 sp04 p214)
* Warning: This routine does not seem numerically stable.
*/
static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
int (*alpha0)[2], int (*alpha1)[2],
const int X_low[32][40][2], int k0)
{
int k;
int shift, round;
for (k = 0; k < k0; k++) {
SoftFloat phi[3][2][2];
SoftFloat a00, a01, a10, a11;
SoftFloat dk;
dsp->autocorrelate(X_low[k], phi);
dk = av_sub_sf(av_mul_sf(phi[2][1][0], phi[1][0][0]),
av_mul_sf(av_add_sf(av_mul_sf(phi[1][1][0], phi[1][1][0]),
av_mul_sf(phi[1][1][1], phi[1][1][1])), FLOAT_0999999));
if (!dk.mant) {
a10 = FLOAT_0;
a11 = FLOAT_0;
} else {
SoftFloat temp_real, temp_im;
temp_real = av_sub_sf(av_sub_sf(av_mul_sf(phi[0][0][0], phi[1][1][0]),
av_mul_sf(phi[0][0][1], phi[1][1][1])),
av_mul_sf(phi[0][1][0], phi[1][0][0]));
temp_im = av_sub_sf(av_add_sf(av_mul_sf(phi[0][0][0], phi[1][1][1]),
av_mul_sf(phi[0][0][1], phi[1][1][0])),
av_mul_sf(phi[0][1][1], phi[1][0][0]));
a10 = av_div_sf(temp_real, dk);
a11 = av_div_sf(temp_im, dk);
}
if (!phi[1][0][0].mant) {
a00 = FLOAT_0;
a01 = FLOAT_0;
} else {
SoftFloat temp_real, temp_im;
temp_real = av_add_sf(phi[0][0][0],
av_add_sf(av_mul_sf(a10, phi[1][1][0]),
av_mul_sf(a11, phi[1][1][1])));
temp_im = av_add_sf(phi[0][0][1],
av_sub_sf(av_mul_sf(a11, phi[1][1][0]),
av_mul_sf(a10, phi[1][1][1])));
temp_real.mant = -temp_real.mant;
temp_im.mant = -temp_im.mant;
a00 = av_div_sf(temp_real, phi[1][0][0]);
a01 = av_div_sf(temp_im, phi[1][0][0]);
}
shift = a00.exp;
if (shift >= 3)
alpha0[k][0] = 0x7fffffff;
else if (shift <= -30)
alpha0[k][0] = 0;
else {
shift = 1-shift;
if (shift <= 0)
alpha0[k][0] = a00.mant * (1<<-shift);
else {
round = 1 << (shift-1);
alpha0[k][0] = (a00.mant + round) >> shift;
}
}
shift = a01.exp;
if (shift >= 3)
alpha0[k][1] = 0x7fffffff;
else if (shift <= -30)
alpha0[k][1] = 0;
else {
shift = 1-shift;
if (shift <= 0)
alpha0[k][1] = a01.mant * (1<<-shift);
else {
round = 1 << (shift-1);
alpha0[k][1] = (a01.mant + round) >> shift;
}
}
shift = a10.exp;
if (shift >= 3)
alpha1[k][0] = 0x7fffffff;
else if (shift <= -30)
alpha1[k][0] = 0;
else {
shift = 1-shift;
if (shift <= 0)
alpha1[k][0] = a10.mant * (1<<-shift);
else {
round = 1 << (shift-1);
alpha1[k][0] = (a10.mant + round) >> shift;
}
}
shift = a11.exp;
if (shift >= 3)
alpha1[k][1] = 0x7fffffff;
else if (shift <= -30)
alpha1[k][1] = 0;
else {
shift = 1-shift;
if (shift <= 0)
alpha1[k][1] = a11.mant * (1<<-shift);
else {
round = 1 << (shift-1);
alpha1[k][1] = (a11.mant + round) >> shift;
}
}
shift = (int)(((int64_t)(alpha1[k][0]>>1) * (alpha1[k][0]>>1) + \
(int64_t)(alpha1[k][1]>>1) * (alpha1[k][1]>>1) + \
0x40000000) >> 31);
if (shift >= 0x20000000){
alpha1[k][0] = 0;
alpha1[k][1] = 0;
alpha0[k][0] = 0;
alpha0[k][1] = 0;
}
shift = (int)(((int64_t)(alpha0[k][0]>>1) * (alpha0[k][0]>>1) + \
(int64_t)(alpha0[k][1]>>1) * (alpha0[k][1]>>1) + \
0x40000000) >> 31);
if (shift >= 0x20000000){
alpha1[k][0] = 0;
alpha1[k][1] = 0;
alpha0[k][0] = 0;
alpha0[k][1] = 0;
}
}
}
/// Chirp Factors (14496-3 sp04 p214)
static void sbr_chirp(SpectralBandReplication *sbr, SBRData *ch_data)
{
int i;
int new_bw;
static const int bw_tab[] = { 0, 1610612736, 1932735283, 2104533975 };
int64_t accu;
for (i = 0; i < sbr->n_q; i++) {
if (ch_data->bs_invf_mode[0][i] + ch_data->bs_invf_mode[1][i] == 1)
new_bw = 1288490189;
else
new_bw = bw_tab[ch_data->bs_invf_mode[0][i]];
if (new_bw < ch_data->bw_array[i]){
accu = (int64_t)new_bw * 1610612736;
accu += (int64_t)ch_data->bw_array[i] * 0x20000000;
new_bw = (int)((accu + 0x40000000) >> 31);
} else {
accu = (int64_t)new_bw * 1946157056;
accu += (int64_t)ch_data->bw_array[i] * 201326592;
new_bw = (int)((accu + 0x40000000) >> 31);
}
ch_data->bw_array[i] = new_bw < 0x2000000 ? 0 : new_bw;
}
}
/**
* Calculation of levels of additional HF signal components (14496-3 sp04 p219)
* and Calculation of gain (14496-3 sp04 p219)
*/
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
SBRData *ch_data, const int e_a[2])
{
int e, k, m;
// max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off)
static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 },
{ 758351638, 1 }, { 625000000, 34 } };
for (e = 0; e < ch_data->bs_num_env; e++) {
int delta = !((e == e_a[1]) || (e == e_a[0]));
for (k = 0; k < sbr->n_lim; k++) {
SoftFloat gain_boost, gain_max;
SoftFloat sum[2];
sum[0] = sum[1] = FLOAT_0;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m],
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]));
sbr->q_m[e][m] = av_sqrt_sf(av_mul_sf(temp, sbr->q_mapped[e][m]));
sbr->s_m[e][m] = av_sqrt_sf(av_mul_sf(temp, av_int2sf(ch_data->s_indexmapped[e + 1][m], 0)));
if (!sbr->s_mapped[e][m]) {
if (delta) {
sbr->gain[e][m] = av_sqrt_sf(av_div_sf(sbr->e_origmapped[e][m],
av_mul_sf(av_add_sf(FLOAT_1, sbr->e_curr[e][m]),
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]))));
} else {
sbr->gain[e][m] = av_sqrt_sf(av_div_sf(sbr->e_origmapped[e][m],
av_add_sf(FLOAT_1, sbr->e_curr[e][m])));
}
} else {
sbr->gain[e][m] = av_sqrt_sf(
av_div_sf(
av_mul_sf(sbr->e_origmapped[e][m], sbr->q_mapped[e][m]),
av_mul_sf(
av_add_sf(FLOAT_1, sbr->e_curr[e][m]),
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]))));
}
sbr->gain[e][m] = av_add_sf(sbr->gain[e][m], FLOAT_MIN);
}
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sum[0] = av_add_sf(sum[0], sbr->e_origmapped[e][m]);
sum[1] = av_add_sf(sum[1], sbr->e_curr[e][m]);
}
gain_max = av_mul_sf(limgain[sbr->bs_limiter_gains],
av_sqrt_sf(
av_div_sf(
av_add_sf(FLOAT_EPSILON, sum[0]),
av_add_sf(FLOAT_EPSILON, sum[1]))));
if (av_gt_sf(gain_max, FLOAT_100000))
gain_max = FLOAT_100000;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
SoftFloat q_m_max = av_div_sf(
av_mul_sf(sbr->q_m[e][m], gain_max),
sbr->gain[e][m]);
if (av_gt_sf(sbr->q_m[e][m], q_m_max))
sbr->q_m[e][m] = q_m_max;
if (av_gt_sf(sbr->gain[e][m], gain_max))
sbr->gain[e][m] = gain_max;
}
sum[0] = sum[1] = FLOAT_0;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sum[0] = av_add_sf(sum[0], sbr->e_origmapped[e][m]);
sum[1] = av_add_sf(sum[1],
av_mul_sf(
av_mul_sf(sbr->e_curr[e][m],
sbr->gain[e][m]),
sbr->gain[e][m]));
sum[1] = av_add_sf(sum[1],
av_mul_sf(sbr->s_m[e][m], sbr->s_m[e][m]));
if (delta && !sbr->s_m[e][m].mant)
sum[1] = av_add_sf(sum[1],
av_mul_sf(sbr->q_m[e][m], sbr->q_m[e][m]));
}
gain_boost = av_sqrt_sf(
av_div_sf(
av_add_sf(FLOAT_EPSILON, sum[0]),
av_add_sf(FLOAT_EPSILON, sum[1])));
if (av_gt_sf(gain_boost, FLOAT_1584893192))
gain_boost = FLOAT_1584893192;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
sbr->gain[e][m] = av_mul_sf(sbr->gain[e][m], gain_boost);
sbr->q_m[e][m] = av_mul_sf(sbr->q_m[e][m], gain_boost);
sbr->s_m[e][m] = av_mul_sf(sbr->s_m[e][m], gain_boost);
}
}
}
}
/// Assembling HF Signals (14496-3 sp04 p220)
static void sbr_hf_assemble(int Y1[38][64][2],
const int X_high[64][40][2],
SpectralBandReplication *sbr, SBRData *ch_data,
const int e_a[2])
{
int e, i, j, m;
const int h_SL = 4 * !sbr->bs_smoothing_mode;
const int kx = sbr->kx[1];
const int m_max = sbr->m[1];
static const SoftFloat h_smooth[5] = {
{ 715827883, -1 },
{ 647472402, -1 },
{ 937030863, -2 },
{ 989249804, -3 },
{ 546843842, -4 },
};
SoftFloat (*g_temp)[48] = ch_data->g_temp, (*q_temp)[48] = ch_data->q_temp;
int indexnoise = ch_data->f_indexnoise;
int indexsine = ch_data->f_indexsine;
if (sbr->reset) {
for (i = 0; i < h_SL; i++) {
memcpy(g_temp[i + 2*ch_data->t_env[0]], sbr->gain[0], m_max * sizeof(sbr->gain[0][0]));
memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0], m_max * sizeof(sbr->q_m[0][0]));
}
} else if (h_SL) {
for (i = 0; i < 4; i++) {
memcpy(g_temp[i + 2 * ch_data->t_env[0]],
g_temp[i + 2 * ch_data->t_env_num_env_old],
sizeof(g_temp[0]));
memcpy(q_temp[i + 2 * ch_data->t_env[0]],
q_temp[i + 2 * ch_data->t_env_num_env_old],
sizeof(q_temp[0]));
}
}
for (e = 0; e < ch_data->bs_num_env; e++) {
for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
memcpy(g_temp[h_SL + i], sbr->gain[e], m_max * sizeof(sbr->gain[0][0]));
memcpy(q_temp[h_SL + i], sbr->q_m[e], m_max * sizeof(sbr->q_m[0][0]));
}
}
for (e = 0; e < ch_data->bs_num_env; e++) {
for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
SoftFloat g_filt_tab[48];
SoftFloat q_filt_tab[48];
SoftFloat *g_filt, *q_filt;
if (h_SL && e != e_a[0] && e != e_a[1]) {
g_filt = g_filt_tab;
q_filt = q_filt_tab;
for (m = 0; m < m_max; m++) {
const int idx1 = i + h_SL;
g_filt[m].mant = g_filt[m].exp = 0;
q_filt[m].mant = q_filt[m].exp = 0;
for (j = 0; j <= h_SL; j++) {
g_filt[m] = av_add_sf(g_filt[m],
av_mul_sf(g_temp[idx1 - j][m],
h_smooth[j]));
q_filt[m] = av_add_sf(q_filt[m],
av_mul_sf(q_temp[idx1 - j][m],
h_smooth[j]));
}
}
} else {
g_filt = g_temp[i + h_SL];
q_filt = q_temp[i];
}
sbr->dsp.hf_g_filt(Y1[i] + kx, X_high + kx, g_filt, m_max,
i + ENVELOPE_ADJUSTMENT_OFFSET);
if (e != e_a[0] && e != e_a[1]) {
sbr->dsp.hf_apply_noise[indexsine](Y1[i] + kx, sbr->s_m[e],
q_filt, indexnoise,
kx, m_max);
} else {
int idx = indexsine&1;
int A = (1-((indexsine+(kx & 1))&2));
int B = (A^(-idx)) + idx;
unsigned *out = &Y1[i][kx][idx];
int shift;
unsigned round;
SoftFloat *in = sbr->s_m[e];
for (m = 0; m+1 < m_max; m+=2) {
int shift2;
shift = 22 - in[m ].exp;
shift2= 22 - in[m+1].exp;
if (shift < 1 || shift2 < 1) {
av_log(NULL, AV_LOG_ERROR, "Overflow in sbr_hf_assemble, shift=%d,%d\n", shift, shift2);
return;
}
if (shift < 32) {
round = 1 << (shift-1);
out[2*m ] += (int)(in[m ].mant * A + round) >> shift;
}
if (shift2 < 32) {
round = 1 << (shift2-1);
out[2*m+2] += (int)(in[m+1].mant * B + round) >> shift2;
}
}
if(m_max&1)
{
shift = 22 - in[m ].exp;
if (shift < 1) {
av_log(NULL, AV_LOG_ERROR, "Overflow in sbr_hf_assemble, shift=%d\n", shift);
return;
} else if (shift < 32) {
round = 1 << (shift-1);
out[2*m ] += (int)(in[m ].mant * A + round) >> shift;
}
}
}
indexnoise = (indexnoise + m_max) & 0x1ff;
indexsine = (indexsine + 1) & 3;
}
}
ch_data->f_indexnoise = indexnoise;
ch_data->f_indexsine = indexsine;
}
#include "aacsbr_template.c"

View file

@ -0,0 +1,28 @@
/*
* Header file for hardcoded AAC SBR windows
*
* Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACSBR_FIXED_TABLEGEN_H
#define AVCODEC_AACSBR_FIXED_TABLEGEN_H
#include "aacsbr_tablegen_common.h"
#endif /* AVCODEC_AACSBR_FIXED_TABLEGEN_H */

View file

@ -0,0 +1,28 @@
/*
* Header file for hardcoded AAC SBR windows
*
* Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACSBR_TABLEGEN_H
#define AVCODEC_AACSBR_TABLEGEN_H
#include "aacsbr_tablegen_common.h"
#endif /* AVCODEC_AACSBR_TABLEGEN_H */

View file

@ -0,0 +1,114 @@
/*
* Header file for hardcoded AAC SBR windows
*
* Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AACSBR_TABLEGEN_COMMON_H
#define AVCODEC_AACSBR_TABLEGEN_COMMON_H
#include "aac_defines.h"
#include "libavutil/mem.h"
///< window coefficients for analysis/synthesis QMF banks
static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320];
static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_us)[640] = {
Q31( 0.0000000000f), Q31(-0.0005525286f), Q31(-0.0005617692f), Q31(-0.0004947518f),
Q31(-0.0004875227f), Q31(-0.0004893791f), Q31(-0.0005040714f), Q31(-0.0005226564f),
Q31(-0.0005466565f), Q31(-0.0005677802f), Q31(-0.0005870930f), Q31(-0.0006132747f),
Q31(-0.0006312493f), Q31(-0.0006540333f), Q31(-0.0006777690f), Q31(-0.0006941614f),
Q31(-0.0007157736f), Q31(-0.0007255043f), Q31(-0.0007440941f), Q31(-0.0007490598f),
Q31(-0.0007681371f), Q31(-0.0007724848f), Q31(-0.0007834332f), Q31(-0.0007779869f),
Q31(-0.0007803664f), Q31(-0.0007801449f), Q31(-0.0007757977f), Q31(-0.0007630793f),
Q31(-0.0007530001f), Q31(-0.0007319357f), Q31(-0.0007215391f), Q31(-0.0006917937f),
Q31(-0.0006650415f), Q31(-0.0006341594f), Q31(-0.0005946118f), Q31(-0.0005564576f),
Q31(-0.0005145572f), Q31(-0.0004606325f), Q31(-0.0004095121f), Q31(-0.0003501175f),
Q31(-0.0002896981f), Q31(-0.0002098337f), Q31(-0.0001446380f), Q31(-0.0000617334f),
Q31( 0.0000134949f), Q31( 0.0001094383f), Q31( 0.0002043017f), Q31( 0.0002949531f),
Q31( 0.0004026540f), Q31( 0.0005107388f), Q31( 0.0006239376f), Q31( 0.0007458025f),
Q31( 0.0008608443f), Q31( 0.0009885988f), Q31( 0.0011250155f), Q31( 0.0012577884f),
Q31( 0.0013902494f), Q31( 0.0015443219f), Q31( 0.0016868083f), Q31( 0.0018348265f),
Q31( 0.0019841140f), Q31( 0.0021461583f), Q31( 0.0023017254f), Q31( 0.0024625616f),
Q31( 0.0026201758f), Q31( 0.0027870464f), Q31( 0.0029469447f), Q31( 0.0031125420f),
Q31( 0.0032739613f), Q31( 0.0034418874f), Q31( 0.0036008268f), Q31( 0.0037603922f),
Q31( 0.0039207432f), Q31( 0.0040819753f), Q31( 0.0042264269f), Q31( 0.0043730719f),
Q31( 0.0045209852f), Q31( 0.0046606460f), Q31( 0.0047932560f), Q31( 0.0049137603f),
Q31( 0.0050393022f), Q31( 0.0051407353f), Q31( 0.0052461166f), Q31( 0.0053471681f),
Q31( 0.0054196775f), Q31( 0.0054876040f), Q31( 0.0055475714f), Q31( 0.0055938023f),
Q31( 0.0056220643f), Q31( 0.0056455196f), Q31( 0.0056389199f), Q31( 0.0056266114f),
Q31( 0.0055917128f), Q31( 0.0055404363f), Q31( 0.0054753783f), Q31( 0.0053838975f),
Q31( 0.0052715758f), Q31( 0.0051382275f), Q31( 0.0049839687f), Q31( 0.0048109469f),
Q31( 0.0046039530f), Q31( 0.0043801861f), Q31( 0.0041251642f), Q31( 0.0038456408f),
Q31( 0.0035401246f), Q31( 0.0032091885f), Q31( 0.0028446757f), Q31( 0.0024508540f),
Q31( 0.0020274176f), Q31( 0.0015784682f), Q31( 0.0010902329f), Q31( 0.0005832264f),
Q31( 0.0000276045f), Q31(-0.0005464280f), Q31(-0.0011568135f), Q31(-0.0018039472f),
Q31(-0.0024826723f), Q31(-0.0031933778f), Q31(-0.0039401124f), Q31(-0.0047222596f),
Q31(-0.0055337211f), Q31(-0.0063792293f), Q31(-0.0072615816f), Q31(-0.0081798233f),
Q31(-0.0091325329f), Q31(-0.0101150215f), Q31(-0.0111315548f), Q31(-0.0121849995f),
Q31( 0.0132718220f), Q31( 0.0143904666f), Q31( 0.0155405553f), Q31( 0.0167324712f),
Q31( 0.0179433381f), Q31( 0.0191872431f), Q31( 0.0204531793f), Q31( 0.0217467550f),
Q31( 0.0230680169f), Q31( 0.0244160992f), Q31( 0.0257875847f), Q31( 0.0271859429f),
Q31( 0.0286072173f), Q31( 0.0300502657f), Q31( 0.0315017608f), Q31( 0.0329754081f),
Q31( 0.0344620948f), Q31( 0.0359697560f), Q31( 0.0374812850f), Q31( 0.0390053679f),
Q31( 0.0405349170f), Q31( 0.0420649094f), Q31( 0.0436097542f), Q31( 0.0451488405f),
Q31( 0.0466843027f), Q31( 0.0482165720f), Q31( 0.0497385755f), Q31( 0.0512556155f),
Q31( 0.0527630746f), Q31( 0.0542452768f), Q31( 0.0557173648f), Q31( 0.0571616450f),
Q31( 0.0585915683f), Q31( 0.0599837480f), Q31( 0.0613455171f), Q31( 0.0626857808f),
Q31( 0.0639715898f), Q31( 0.0652247106f), Q31( 0.0664367512f), Q31( 0.0676075985f),
Q31( 0.0687043828f), Q31( 0.0697630244f), Q31( 0.0707628710f), Q31( 0.0717002673f),
Q31( 0.0725682583f), Q31( 0.0733620255f), Q31( 0.0741003642f), Q31( 0.0747452558f),
Q31( 0.0753137336f), Q31( 0.0758008358f), Q31( 0.0761992479f), Q31( 0.0764992170f),
Q31( 0.0767093490f), Q31( 0.0768173975f), Q31( 0.0768230011f), Q31( 0.0767204924f),
Q31( 0.0765050718f), Q31( 0.0761748321f), Q31( 0.0757305756f), Q31( 0.0751576255f),
Q31( 0.0744664394f), Q31( 0.0736406005f), Q31( 0.0726774642f), Q31( 0.0715826364f),
Q31( 0.0703533073f), Q31( 0.0689664013f), Q31( 0.0674525021f), Q31( 0.0657690668f),
Q31( 0.0639444805f), Q31( 0.0619602779f), Q31( 0.0598166570f), Q31( 0.0575152691f),
Q31( 0.0550460034f), Q31( 0.0524093821f), Q31( 0.0495978676f), Q31( 0.0466303305f),
Q31( 0.0434768782f), Q31( 0.0401458278f), Q31( 0.0366418116f), Q31( 0.0329583930f),
Q31( 0.0290824006f), Q31( 0.0250307561f), Q31( 0.0207997072f), Q31( 0.0163701258f),
Q31( 0.0117623832f), Q31( 0.0069636862f), Q31( 0.0019765601f), Q31(-0.0032086896f),
Q31(-0.0085711749f), Q31(-0.0141288827f), Q31(-0.0198834129f), Q31(-0.0258227288f),
Q31(-0.0319531274f), Q31(-0.0382776572f), Q31(-0.0447806821f), Q31(-0.0514804176f),
Q31(-0.0583705326f), Q31(-0.0654409853f), Q31(-0.0726943300f), Q31(-0.0801372934f),
Q31(-0.0877547536f), Q31(-0.0955533352f), Q31(-0.1035329531f), Q31(-0.1116826931f),
Q31(-0.1200077984f), Q31(-0.1285002850f), Q31(-0.1371551761f), Q31(-0.1459766491f),
Q31(-0.1549607071f), Q31(-0.1640958855f), Q31(-0.1733808172f), Q31(-0.1828172548f),
Q31(-0.1923966745f), Q31(-0.2021250176f), Q31(-0.2119735853f), Q31(-0.2219652696f),
Q31(-0.2320690870f), Q31(-0.2423016884f), Q31(-0.2526480309f), Q31(-0.2631053299f),
Q31(-0.2736634040f), Q31(-0.2843214189f), Q31(-0.2950716717f), Q31(-0.3059098575f),
Q31(-0.3168278913f), Q31(-0.3278113727f), Q31(-0.3388722693f), Q31(-0.3499914122f),
Q31( 0.3611589903f), Q31( 0.3723795546f), Q31( 0.3836350013f), Q31( 0.3949211761f),
Q31( 0.4062317676f), Q31( 0.4175696896f), Q31( 0.4289119920f), Q31( 0.4402553754f),
Q31( 0.4515996535f), Q31( 0.4629308085f), Q31( 0.4742453214f), Q31( 0.4855253091f),
Q31( 0.4967708254f), Q31( 0.5079817500f), Q31( 0.5191234970f), Q31( 0.5302240895f),
Q31( 0.5412553448f), Q31( 0.5522051258f), Q31( 0.5630789140f), Q31( 0.5738524131f),
Q31( 0.5845403235f), Q31( 0.5951123086f), Q31( 0.6055783538f), Q31( 0.6159109932f),
Q31( 0.6261242695f), Q31( 0.6361980107f), Q31( 0.6461269695f), Q31( 0.6559016302f),
Q31( 0.6655139880f), Q31( 0.6749663190f), Q31( 0.6842353293f), Q31( 0.6933282376f),
Q31( 0.7022388719f), Q31( 0.7109410426f), Q31( 0.7194462634f), Q31( 0.7277448900f),
Q31( 0.7358211758f), Q31( 0.7436827863f), Q31( 0.7513137456f), Q31( 0.7587080760f),
Q31( 0.7658674865f), Q31( 0.7727780881f), Q31( 0.7794287519f), Q31( 0.7858353120f),
Q31( 0.7919735841f), Q31( 0.7978466413f), Q31( 0.8034485751f), Q31( 0.8087695004f),
Q31( 0.8138191270f), Q31( 0.8185776004f), Q31( 0.8230419890f), Q31( 0.8272275347f),
Q31( 0.8311038457f), Q31( 0.8346937361f), Q31( 0.8379717337f), Q31( 0.8409541392f),
Q31( 0.8436238281f), Q31( 0.8459818469f), Q31( 0.8480315777f), Q31( 0.8497805198f),
Q31( 0.8511971524f), Q31( 0.8523047035f), Q31( 0.8531020949f), Q31( 0.8535720573f),
Q31( 0.8537385600f),
};
#endif /* AVCODEC_AACSBR_TABLEGEN_COMMON_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,535 @@
/*
* AAC Spectral Band Replication decoding data
* Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* AAC Spectral Band Replication decoding data
* @author Robert Swain ( rob opendot cl )
*/
#ifndef AVCODEC_AACSBRDATA_H
#define AVCODEC_AACSBRDATA_H
#include <stdint.h>
#include "libavutil/mem.h"
#include "aac_defines.h"
///< Huffman tables for SBR
static const uint8_t t_huffman_env_1_5dB_bits[121] = {
18, 18, 18, 18, 18, 18, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 17, 18, 16, 17, 18, 17,
16, 16, 16, 16, 15, 14, 14, 13,
13, 12, 11, 10, 9, 8, 7, 6,
5, 4, 3, 2, 2, 3, 4, 5,
6, 7, 8, 9, 10, 12, 13, 14,
14, 15, 16, 17, 16, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19,
};
static const uint32_t t_huffman_env_1_5dB_codes[121] = {
0x3ffd6, 0x3ffd7, 0x3ffd8, 0x3ffd9, 0x3ffda, 0x3ffdb, 0x7ffb8, 0x7ffb9,
0x7ffba, 0x7ffbb, 0x7ffbc, 0x7ffbd, 0x7ffbe, 0x7ffbf, 0x7ffc0, 0x7ffc1,
0x7ffc2, 0x7ffc3, 0x7ffc4, 0x7ffc5, 0x7ffc6, 0x7ffc7, 0x7ffc8, 0x7ffc9,
0x7ffca, 0x7ffcb, 0x7ffcc, 0x7ffcd, 0x7ffce, 0x7ffcf, 0x7ffd0, 0x7ffd1,
0x7ffd2, 0x7ffd3, 0x1ffe6, 0x3ffd4, 0x0fff0, 0x1ffe9, 0x3ffd5, 0x1ffe7,
0x0fff1, 0x0ffec, 0x0ffed, 0x0ffee, 0x07ff4, 0x03ff9, 0x03ff7, 0x01ffa,
0x01ff9, 0x00ffb, 0x007fc, 0x003fc, 0x001fd, 0x000fd, 0x0007d, 0x0003d,
0x0001d, 0x0000d, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000c, 0x0001c,
0x0003c, 0x0007c, 0x000fc, 0x001fc, 0x003fd, 0x00ffa, 0x01ff8, 0x03ff6,
0x03ff8, 0x07ff5, 0x0ffef, 0x1ffe8, 0x0fff2, 0x7ffd4, 0x7ffd5, 0x7ffd6,
0x7ffd7, 0x7ffd8, 0x7ffd9, 0x7ffda, 0x7ffdb, 0x7ffdc, 0x7ffdd, 0x7ffde,
0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3, 0x7ffe4, 0x7ffe5, 0x7ffe6,
0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb, 0x7ffec, 0x7ffed, 0x7ffee,
0x7ffef, 0x7fff0, 0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6,
0x7fff7, 0x7fff8, 0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe,
0x7ffff,
};
static const uint8_t f_huffman_env_1_5dB_bits[121] = {
19, 19, 20, 20, 20, 20, 20, 20,
20, 19, 20, 20, 20, 20, 19, 20,
19, 19, 20, 18, 20, 20, 20, 19,
20, 20, 20, 19, 20, 19, 18, 19,
18, 18, 17, 18, 17, 17, 17, 16,
16, 16, 15, 15, 14, 13, 13, 12,
12, 11, 10, 9, 9, 8, 7, 6,
5, 4, 3, 2, 2, 3, 4, 5,
6, 8, 8, 9, 10, 11, 11, 11,
12, 12, 13, 13, 14, 14, 16, 16,
17, 17, 18, 18, 18, 18, 18, 18,
18, 20, 19, 20, 20, 20, 20, 20,
20, 19, 20, 20, 20, 20, 19, 20,
18, 20, 20, 19, 19, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20,
20,
};
static const uint32_t f_huffman_env_1_5dB_codes[121] = {
0x7ffe7, 0x7ffe8, 0xfffd2, 0xfffd3, 0xfffd4, 0xfffd5, 0xfffd6, 0xfffd7,
0xfffd8, 0x7ffda, 0xfffd9, 0xfffda, 0xfffdb, 0xfffdc, 0x7ffdb, 0xfffdd,
0x7ffdc, 0x7ffdd, 0xfffde, 0x3ffe4, 0xfffdf, 0xfffe0, 0xfffe1, 0x7ffde,
0xfffe2, 0xfffe3, 0xfffe4, 0x7ffdf, 0xfffe5, 0x7ffe0, 0x3ffe8, 0x7ffe1,
0x3ffe0, 0x3ffe9, 0x1ffef, 0x3ffe5, 0x1ffec, 0x1ffed, 0x1ffee, 0x0fff4,
0x0fff3, 0x0fff0, 0x07ff7, 0x07ff6, 0x03ffa, 0x01ffa, 0x01ff9, 0x00ffa,
0x00ff8, 0x007f9, 0x003fb, 0x001fc, 0x001fa, 0x000fb, 0x0007c, 0x0003c,
0x0001c, 0x0000c, 0x00005, 0x00001, 0x00000, 0x00004, 0x0000d, 0x0001d,
0x0003d, 0x000fa, 0x000fc, 0x001fb, 0x003fa, 0x007f8, 0x007fa, 0x007fb,
0x00ff9, 0x00ffb, 0x01ff8, 0x01ffb, 0x03ff8, 0x03ff9, 0x0fff1, 0x0fff2,
0x1ffea, 0x1ffeb, 0x3ffe1, 0x3ffe2, 0x3ffea, 0x3ffe3, 0x3ffe6, 0x3ffe7,
0x3ffeb, 0xfffe6, 0x7ffe2, 0xfffe7, 0xfffe8, 0xfffe9, 0xfffea, 0xfffeb,
0xfffec, 0x7ffe3, 0xfffed, 0xfffee, 0xfffef, 0xffff0, 0x7ffe4, 0xffff1,
0x3ffec, 0xffff2, 0xffff3, 0x7ffe5, 0x7ffe6, 0xffff4, 0xffff5, 0xffff6,
0xffff7, 0xffff8, 0xffff9, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe,
0xfffff,
};
static const uint8_t t_huffman_env_bal_1_5dB_bits[49] = {
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 12, 11, 9, 7, 5, 3,
1, 2, 4, 6, 8, 11, 12, 15,
16, 16, 16, 16, 16, 16, 16, 17,
17, 17, 17, 17, 17, 17, 17, 17,
17,
};
static const uint32_t t_huffman_env_bal_1_5dB_codes[49] = {
0x0ffe4, 0x0ffe5, 0x0ffe6, 0x0ffe7, 0x0ffe8, 0x0ffe9, 0x0ffea, 0x0ffeb,
0x0ffec, 0x0ffed, 0x0ffee, 0x0ffef, 0x0fff0, 0x0fff1, 0x0fff2, 0x0fff3,
0x0fff4, 0x0ffe2, 0x00ffc, 0x007fc, 0x001fe, 0x0007e, 0x0001e, 0x00006,
0x00000, 0x00002, 0x0000e, 0x0003e, 0x000fe, 0x007fd, 0x00ffd, 0x07ff0,
0x0ffe3, 0x0fff5, 0x0fff6, 0x0fff7, 0x0fff8, 0x0fff9, 0x0fffa, 0x1fff6,
0x1fff7, 0x1fff8, 0x1fff9, 0x1fffa, 0x1fffb, 0x1fffc, 0x1fffd, 0x1fffe,
0x1ffff,
};
static const uint8_t f_huffman_env_bal_1_5dB_bits[49] = {
18, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 16,
17, 14, 11, 11, 8, 7, 4, 2,
1, 3, 5, 6, 9, 11, 12, 15,
16, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 19,
19,
};
static const uint32_t f_huffman_env_bal_1_5dB_codes[49] = {
0x3ffe2, 0x3ffe3, 0x3ffe4, 0x3ffe5, 0x3ffe6, 0x3ffe7, 0x3ffe8, 0x3ffe9,
0x3ffea, 0x3ffeb, 0x3ffec, 0x3ffed, 0x3ffee, 0x3ffef, 0x3fff0, 0x0fff7,
0x1fff0, 0x03ffc, 0x007fe, 0x007fc, 0x000fe, 0x0007e, 0x0000e, 0x00002,
0x00000, 0x00006, 0x0001e, 0x0003e, 0x001fe, 0x007fd, 0x00ffe, 0x07ffa,
0x0fff6, 0x3fff1, 0x3fff2, 0x3fff3, 0x3fff4, 0x3fff5, 0x3fff6, 0x3fff7,
0x3fff8, 0x3fff9, 0x3fffa, 0x3fffb, 0x3fffc, 0x3fffd, 0x3fffe, 0x7fffe,
0x7ffff,
};
static const uint8_t t_huffman_env_3_0dB_bits[63] = {
18, 18, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 17, 16, 16, 16, 14, 14, 14,
13, 12, 11, 8, 6, 4, 2, 1,
3, 5, 7, 9, 11, 13, 14, 14,
15, 16, 17, 18, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19,
};
static const uint32_t t_huffman_env_3_0dB_codes[63] = {
0x3ffed, 0x3ffee, 0x7ffde, 0x7ffdf, 0x7ffe0, 0x7ffe1, 0x7ffe2, 0x7ffe3,
0x7ffe4, 0x7ffe5, 0x7ffe6, 0x7ffe7, 0x7ffe8, 0x7ffe9, 0x7ffea, 0x7ffeb,
0x7ffec, 0x1fff4, 0x0fff7, 0x0fff9, 0x0fff8, 0x03ffb, 0x03ffa, 0x03ff8,
0x01ffa, 0x00ffc, 0x007fc, 0x000fe, 0x0003e, 0x0000e, 0x00002, 0x00000,
0x00006, 0x0001e, 0x0007e, 0x001fe, 0x007fd, 0x01ffb, 0x03ff9, 0x03ffc,
0x07ffa, 0x0fff6, 0x1fff5, 0x3ffec, 0x7ffed, 0x7ffee, 0x7ffef, 0x7fff0,
0x7fff1, 0x7fff2, 0x7fff3, 0x7fff4, 0x7fff5, 0x7fff6, 0x7fff7, 0x7fff8,
0x7fff9, 0x7fffa, 0x7fffb, 0x7fffc, 0x7fffd, 0x7fffe, 0x7ffff,
};
static const uint8_t f_huffman_env_3_0dB_bits[63] = {
20, 20, 20, 20, 20, 20, 20, 18,
19, 19, 19, 19, 18, 18, 20, 19,
17, 18, 17, 16, 16, 15, 14, 12,
11, 10, 9, 8, 6, 4, 2, 1,
3, 5, 8, 9, 10, 11, 12, 13,
14, 15, 15, 16, 16, 17, 17, 18,
18, 18, 20, 19, 19, 19, 20, 19,
19, 20, 20, 20, 20, 20, 20,
};
static const uint32_t f_huffman_env_3_0dB_codes[63] = {
0xffff0, 0xffff1, 0xffff2, 0xffff3, 0xffff4, 0xffff5, 0xffff6, 0x3fff3,
0x7fff5, 0x7ffee, 0x7ffef, 0x7fff6, 0x3fff4, 0x3fff2, 0xffff7, 0x7fff0,
0x1fff5, 0x3fff0, 0x1fff4, 0x0fff7, 0x0fff6, 0x07ff8, 0x03ffb, 0x00ffd,
0x007fd, 0x003fd, 0x001fd, 0x000fd, 0x0003e, 0x0000e, 0x00002, 0x00000,
0x00006, 0x0001e, 0x000fc, 0x001fc, 0x003fc, 0x007fc, 0x00ffc, 0x01ffc,
0x03ffa, 0x07ff9, 0x07ffa, 0x0fff8, 0x0fff9, 0x1fff6, 0x1fff7, 0x3fff5,
0x3fff6, 0x3fff1, 0xffff8, 0x7fff1, 0x7fff2, 0x7fff3, 0xffff9, 0x7fff7,
0x7fff4, 0xffffa, 0xffffb, 0xffffc, 0xffffd, 0xffffe, 0xfffff,
};
static const uint8_t t_huffman_env_bal_3_0dB_bits[25] = {
13, 13, 13, 13, 13, 13, 13, 12,
8, 7, 4, 3, 1, 2, 5, 6,
9, 13, 13, 13, 13, 13, 13, 14,
14,
};
static const uint16_t t_huffman_env_bal_3_0dB_codes[25] = {
0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x0ff8,
0x00fe, 0x007e, 0x000e, 0x0006, 0x0000, 0x0002, 0x001e, 0x003e,
0x01fe, 0x1ff9, 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe,
0x3fff,
};
static const uint8_t f_huffman_env_bal_3_0dB_bits[25] = {
13, 13, 13, 13, 13, 14, 14, 11,
8, 7, 4, 2, 1, 3, 5, 6,
9, 12, 13, 14, 14, 14, 14, 14,
14,
};
static const uint16_t f_huffman_env_bal_3_0dB_codes[25] = {
0x1ff7, 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x3ff8, 0x3ff9, 0x07fc,
0x00fe, 0x007e, 0x000e, 0x0002, 0x0000, 0x0006, 0x001e, 0x003e,
0x01fe, 0x0ffa, 0x1ff6, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe,
0x3fff,
};
static const uint8_t t_huffman_noise_3_0dB_bits[63] = {
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 11, 8, 6, 4, 3, 1,
2, 5, 8, 10, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 14, 14,
};
static const uint16_t t_huffman_noise_3_0dB_codes[63] = {
0x1fce, 0x1fcf, 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5,
0x1fd6, 0x1fd7, 0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fdc, 0x1fdd,
0x1fde, 0x1fdf, 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5,
0x1fe6, 0x1fe7, 0x07f2, 0x00fd, 0x003e, 0x000e, 0x0006, 0x0000,
0x0002, 0x001e, 0x00fc, 0x03f8, 0x1fcc, 0x1fe8, 0x1fe9, 0x1fea,
0x1feb, 0x1fec, 0x1fcd, 0x1fed, 0x1fee, 0x1fef, 0x1ff0, 0x1ff1,
0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1ff8, 0x1ff9,
0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x3ffe, 0x3fff,
};
static const uint8_t t_huffman_noise_bal_3_0dB_bits[25] = {
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 5, 2, 1, 3, 6, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8,
};
static const uint8_t t_huffman_noise_bal_3_0dB_codes[25] = {
0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,
0xf4, 0xf5, 0x1c, 0x02, 0x00, 0x06, 0x3a, 0xf6,
0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe,
0xff,
};
static const int8_t sbr_offset[6][16] = {
{-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, // fs_sbr = 16000 Hz
{-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}, // fs_sbr = 22050 Hz
{-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 24000 Hz
{-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 32000 Hz
{-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}, // 44100 Hz <= fs_sbr <= 64000 Hz
{-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr
};
/* First eight entries repeated at end to simplify SIMD implementations. */
const DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sbr_noise_table))[][2] = {
{Q31(-0.99948153278296f), Q31(-0.59483417516607f)}, {Q31( 0.97113454393991f), Q31(-0.67528515225647f)},
{Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)},
{Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)},
{Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)},
{Q31( 0.54840422910309f), Q31( 0.75221367176302f)}, {Q31( 0.40009252867955f), Q31(-0.98929400334421f)},
{Q31(-0.99867974711855f), Q31(-0.88147068645358f)}, {Q31(-0.95531076805040f), Q31( 0.90908757154593f)},
{Q31(-0.45725933317144f), Q31(-0.56716323646760f)}, {Q31(-0.72929675029275f), Q31(-0.98008272727324f)},
{Q31( 0.75622801399036f), Q31( 0.20950329995549f)}, {Q31( 0.07069442601050f), Q31(-0.78247898470706f)},
{Q31( 0.74496252926055f), Q31(-0.91169004445807f)}, {Q31(-0.96440182703856f), Q31(-0.94739918296622f)},
{Q31( 0.30424629369539f), Q31(-0.49438267012479f)}, {Q31( 0.66565033746925f), Q31( 0.64652935542491f)},
{Q31( 0.91697008020594f), Q31( 0.17514097332009f)}, {Q31(-0.70774918760427f), Q31( 0.52548653416543f)},
{Q31(-0.70051415345560f), Q31(-0.45340028808763f)}, {Q31(-0.99496513054797f), Q31(-0.90071908066973f)},
{Q31( 0.98164490790123f), Q31(-0.77463155528697f)}, {Q31(-0.54671580548181f), Q31(-0.02570928536004f)},
{Q31(-0.01689629065389f), Q31( 0.00287506445732f)}, {Q31(-0.86110349531986f), Q31( 0.42548583726477f)},
{Q31(-0.98892980586032f), Q31(-0.87881132267556f)}, {Q31( 0.51756627678691f), Q31( 0.66926784710139f)},
{Q31(-0.99635026409640f), Q31(-0.58107730574765f)}, {Q31(-0.99969370862163f), Q31( 0.98369989360250f)},
{Q31( 0.55266258627194f), Q31( 0.59449057465591f)}, {Q31( 0.34581177741673f), Q31( 0.94879421061866f)},
{Q31( 0.62664209577999f), Q31(-0.74402970906471f)}, {Q31(-0.77149701404973f), Q31(-0.33883658042801f)},
{Q31(-0.91592244254432f), Q31( 0.03687901376713f)}, {Q31(-0.76285492357887f), Q31(-0.91371867919124f)},
{Q31( 0.79788337195331f), Q31(-0.93180971199849f)}, {Q31( 0.54473080610200f), Q31(-0.11919206037186f)},
{Q31(-0.85639281671058f), Q31( 0.42429854760451f)}, {Q31(-0.92882402971423f), Q31( 0.27871809078609f)},
{Q31(-0.11708371046774f), Q31(-0.99800843444966f)}, {Q31( 0.21356749817493f), Q31(-0.90716295627033f)},
{Q31(-0.76191692573909f), Q31( 0.99768118356265f)}, {Q31( 0.98111043100884f), Q31(-0.95854459734407f)},
{Q31(-0.85913269895572f), Q31( 0.95766566168880f)}, {Q31(-0.93307242253692f), Q31( 0.49431757696466f)},
{Q31( 0.30485754879632f), Q31(-0.70540034357529f)}, {Q31( 0.85289650925190f), Q31( 0.46766131791044f)},
{Q31( 0.91328082618125f), Q31(-0.99839597361769f)}, {Q31(-0.05890199924154f), Q31( 0.70741827819497f)},
{Q31( 0.28398686150148f), Q31( 0.34633555702188f)}, {Q31( 0.95258164539612f), Q31(-0.54893416026939f)},
{Q31(-0.78566324168507f), Q31(-0.75568541079691f)}, {Q31(-0.95789495447877f), Q31(-0.20423194696966f)},
{Q31( 0.82411158711197f), Q31( 0.96654618432562f)}, {Q31(-0.65185446735885f), Q31(-0.88734990773289f)},
{Q31(-0.93643603134666f), Q31( 0.99870790442385f)}, {Q31( 0.91427159529618f), Q31(-0.98290505544444f)},
{Q31(-0.70395684036886f), Q31( 0.58796798221039f)}, {Q31( 0.00563771969365f), Q31( 0.61768196727244f)},
{Q31( 0.89065051931895f), Q31( 0.52783352697585f)}, {Q31(-0.68683707712762f), Q31( 0.80806944710339f)},
{Q31( 0.72165342518718f), Q31(-0.69259857349564f)}, {Q31(-0.62928247730667f), Q31( 0.13627037407335f)},
{Q31( 0.29938434065514f), Q31(-0.46051329682246f)}, {Q31(-0.91781958879280f), Q31(-0.74012716684186f)},
{Q31( 0.99298717043688f), Q31( 0.40816610075661f)}, {Q31( 0.82368298622748f), Q31(-0.74036047190173f)},
{Q31(-0.98512833386833f), Q31(-0.99972330709594f)}, {Q31(-0.95915368242257f), Q31(-0.99237800466040f)},
{Q31(-0.21411126572790f), Q31(-0.93424819052545f)}, {Q31(-0.68821476106884f), Q31(-0.26892306315457f)},
{Q31( 0.91851997982317f), Q31( 0.09358228901785f)}, {Q31(-0.96062769559127f), Q31( 0.36099095133739f)},
{Q31( 0.51646184922287f), Q31(-0.71373332873917f)}, {Q31( 0.61130721139669f), Q31( 0.46950141175917f)},
{Q31( 0.47336129371299f), Q31(-0.27333178296162f)}, {Q31( 0.90998308703519f), Q31( 0.96715662938132f)},
{Q31( 0.44844799194357f), Q31( 0.99211574628306f)}, {Q31( 0.66614891079092f), Q31( 0.96590176169121f)},
{Q31( 0.74922239129237f), Q31(-0.89879858826087f)}, {Q31(-0.99571588506485f), Q31( 0.52785521494349f)},
{Q31( 0.97401082477563f), Q31(-0.16855870075190f)}, {Q31( 0.72683747733879f), Q31(-0.48060774432251f)},
{Q31( 0.95432193457128f), Q31( 0.68849603408441f)}, {Q31(-0.72962208425191f), Q31(-0.76608443420917f)},
{Q31(-0.85359479233537f), Q31( 0.88738125901579f)}, {Q31(-0.81412430338535f), Q31(-0.97480768049637f)},
{Q31(-0.87930772356786f), Q31( 0.74748307690436f)}, {Q31(-0.71573331064977f), Q31(-0.98570608178923f)},
{Q31( 0.83524300028228f), Q31( 0.83702537075163f)}, {Q31(-0.48086065601423f), Q31(-0.98848504923531f)},
{Q31( 0.97139128574778f), Q31( 0.80093621198236f)}, {Q31( 0.51992825347895f), Q31( 0.80247631400510f)},
{Q31(-0.00848591195325f), Q31(-0.76670128000486f)}, {Q31(-0.70294374303036f), Q31( 0.55359910445577f)},
{Q31(-0.95894428168140f), Q31(-0.43265504344783f)}, {Q31( 0.97079252950321f), Q31( 0.09325857238682f)},
{Q31(-0.92404293670797f), Q31( 0.85507704027855f)}, {Q31(-0.69506469500450f), Q31( 0.98633412625459f)},
{Q31( 0.26559203620024f), Q31( 0.73314307966524f)}, {Q31( 0.28038443336943f), Q31( 0.14537913654427f)},
{Q31(-0.74138124825523f), Q31( 0.99310339807762f)}, {Q31(-0.01752795995444f), Q31(-0.82616635284178f)},
{Q31(-0.55126773094930f), Q31(-0.98898543862153f)}, {Q31( 0.97960898850996f), Q31(-0.94021446752851f)},
{Q31(-0.99196309146936f), Q31( 0.67019017358456f)}, {Q31(-0.67684928085260f), Q31( 0.12631491649378f)},
{Q31( 0.09140039465500f), Q31(-0.20537731453108f)}, {Q31(-0.71658965751996f), Q31(-0.97788200391224f)},
{Q31( 0.81014640078925f), Q31( 0.53722648362443f)}, {Q31( 0.40616991671205f), Q31(-0.26469008598449f)},
{Q31(-0.67680188682972f), Q31( 0.94502052337695f)}, {Q31( 0.86849774348749f), Q31(-0.18333598647899f)},
{Q31(-0.99500381284851f), Q31(-0.02634122068550f)}, {Q31( 0.84329189340667f), Q31( 0.10406957462213f)},
{Q31(-0.09215968531446f), Q31( 0.69540012101253f)}, {Q31( 0.99956173327206f), Q31(-0.12358542001404f)},
{Q31(-0.79732779473535f), Q31(-0.91582524736159f)}, {Q31( 0.96349973642406f), Q31( 0.96640458041000f)},
{Q31(-0.79942778496547f), Q31( 0.64323902822857f)}, {Q31(-0.11566039853896f), Q31( 0.28587846253726f)},
{Q31(-0.39922954514662f), Q31( 0.94129601616966f)}, {Q31( 0.99089197565987f), Q31(-0.92062625581587f)},
{Q31( 0.28631285179909f), Q31(-0.91035047143603f)}, {Q31(-0.83302725605608f), Q31(-0.67330410892084f)},
{Q31( 0.95404443402072f), Q31( 0.49162765398743f)}, {Q31(-0.06449863579434f), Q31( 0.03250560813135f)},
{Q31(-0.99575054486311f), Q31( 0.42389784469507f)}, {Q31(-0.65501142790847f), Q31( 0.82546114655624f)},
{Q31(-0.81254441908887f), Q31(-0.51627234660629f)}, {Q31(-0.99646369485481f), Q31( 0.84490533520752f)},
{Q31( 0.00287840603348f), Q31( 0.64768261158166f)}, {Q31( 0.70176989408455f), Q31(-0.20453028573322f)},
{Q31( 0.96361882270190f), Q31( 0.40706967140989f)}, {Q31(-0.68883758192426f), Q31( 0.91338958840772f)},
{Q31(-0.34875585502238f), Q31( 0.71472290693300f)}, {Q31( 0.91980081243087f), Q31( 0.66507455644919f)},
{Q31(-0.99009048343881f), Q31( 0.85868021604848f)}, {Q31( 0.68865791458395f), Q31( 0.55660316809678f)},
{Q31(-0.99484402129368f), Q31(-0.20052559254934f)}, {Q31( 0.94214511408023f), Q31(-0.99696425367461f)},
{Q31(-0.67414626793544f), Q31( 0.49548221180078f)}, {Q31(-0.47339353684664f), Q31(-0.85904328834047f)},
{Q31( 0.14323651387360f), Q31(-0.94145598222488f)}, {Q31(-0.29268293575672f), Q31( 0.05759224927952f)},
{Q31( 0.43793861458754f), Q31(-0.78904969892724f)}, {Q31(-0.36345126374441f), Q31( 0.64874435357162f)},
{Q31(-0.08750604656825f), Q31( 0.97686944362527f)}, {Q31(-0.96495267812511f), Q31(-0.53960305946511f)},
{Q31( 0.55526940659947f), Q31( 0.78891523734774f)}, {Q31( 0.73538215752630f), Q31( 0.96452072373404f)},
{Q31(-0.30889773919437f), Q31(-0.80664389776860f)}, {Q31( 0.03574995626194f), Q31(-0.97325616900959f)},
{Q31( 0.98720684660488f), Q31( 0.48409133691962f)}, {Q31(-0.81689296271203f), Q31(-0.90827703628298f)},
{Q31( 0.67866860118215f), Q31( 0.81284503870856f)}, {Q31(-0.15808569732583f), Q31( 0.85279555024382f)},
{Q31( 0.80723395114371f), Q31(-0.24717418514605f)}, {Q31( 0.47788757329038f), Q31(-0.46333147839295f)},
{Q31( 0.96367554763201f), Q31( 0.38486749303242f)}, {Q31(-0.99143875716818f), Q31(-0.24945277239809f)},
{Q31( 0.83081876925833f), Q31(-0.94780851414763f)}, {Q31(-0.58753191905341f), Q31( 0.01290772389163f)},
{Q31( 0.95538108220960f), Q31(-0.85557052096538f)}, {Q31(-0.96490920476211f), Q31(-0.64020970923102f)},
{Q31(-0.97327101028521f), Q31( 0.12378128133110f)}, {Q31( 0.91400366022124f), Q31( 0.57972471346930f)},
{Q31(-0.99925837363824f), Q31( 0.71084847864067f)}, {Q31(-0.86875903507313f), Q31(-0.20291699203564f)},
{Q31(-0.26240034795124f), Q31(-0.68264554369108f)}, {Q31(-0.24664412953388f), Q31(-0.87642273115183f)},
{Q31( 0.02416275806869f), Q31( 0.27192914288905f)}, {Q31( 0.82068619590515f), Q31(-0.85087787994476f)},
{Q31( 0.88547373760759f), Q31(-0.89636802901469f)}, {Q31(-0.18173078152226f), Q31(-0.26152145156800f)},
{Q31( 0.09355476558534f), Q31( 0.54845123045604f)}, {Q31(-0.54668414224090f), Q31( 0.95980774020221f)},
{Q31( 0.37050990604091f), Q31(-0.59910140383171f)}, {Q31(-0.70373594262891f), Q31( 0.91227665827081f)},
{Q31(-0.34600785879594f), Q31(-0.99441426144200f)}, {Q31(-0.68774481731008f), Q31(-0.30238837956299f)},
{Q31(-0.26843291251234f), Q31( 0.83115668004362f)}, {Q31( 0.49072334613242f), Q31(-0.45359708737775f)},
{Q31( 0.38975993093975f), Q31( 0.95515358099121f)}, {Q31(-0.97757125224150f), Q31( 0.05305894580606f)},
{Q31(-0.17325552859616f), Q31(-0.92770672250494f)}, {Q31( 0.99948035025744f), Q31( 0.58285545563426f)},
{Q31(-0.64946246527458f), Q31( 0.68645507104960f)}, {Q31(-0.12016920576437f), Q31(-0.57147322153312f)},
{Q31(-0.58947456517751f), Q31(-0.34847132454388f)}, {Q31(-0.41815140454465f), Q31( 0.16276422358861f)},
{Q31( 0.99885650204884f), Q31( 0.11136095490444f)}, {Q31(-0.56649614128386f), Q31(-0.90494866361587f)},
{Q31( 0.94138021032330f), Q31( 0.35281916733018f)}, {Q31(-0.75725076534641f), Q31( 0.53650549640587f)},
{Q31( 0.20541973692630f), Q31(-0.94435144369918f)}, {Q31( 0.99980371023351f), Q31( 0.79835913565599f)},
{Q31( 0.29078277605775f), Q31( 0.35393777921520f)}, {Q31(-0.62858772103030f), Q31( 0.38765693387102f)},
{Q31( 0.43440904467688f), Q31(-0.98546330463232f)}, {Q31(-0.98298583762390f), Q31( 0.21021524625209f)},
{Q31( 0.19513029146934f), Q31(-0.94239832251867f)}, {Q31(-0.95476662400101f), Q31( 0.98364554179143f)},
{Q31( 0.93379635304810f), Q31(-0.70881994583682f)}, {Q31(-0.85235410573336f), Q31(-0.08342347966410f)},
{Q31(-0.86425093011245f), Q31(-0.45795025029466f)}, {Q31( 0.38879779059045f), Q31( 0.97274429344593f)},
{Q31( 0.92045124735495f), Q31(-0.62433652524220f)}, {Q31( 0.89162532251878f), Q31( 0.54950955570563f)},
{Q31(-0.36834336949252f), Q31( 0.96458298020975f)}, {Q31( 0.93891760988045f), Q31(-0.89968353740388f)},
{Q31( 0.99267657565094f), Q31(-0.03757034316958f)}, {Q31(-0.94063471614176f), Q31( 0.41332338538963f)},
{Q31( 0.99740224117019f), Q31(-0.16830494996370f)}, {Q31(-0.35899413170555f), Q31(-0.46633226649613f)},
{Q31( 0.05237237274947f), Q31(-0.25640361602661f)}, {Q31( 0.36703583957424f), Q31(-0.38653265641875f)},
{Q31( 0.91653180367913f), Q31(-0.30587628726597f)}, {Q31( 0.69000803499316f), Q31( 0.90952171386132f)},
{Q31(-0.38658751133527f), Q31( 0.99501571208985f)}, {Q31(-0.29250814029851f), Q31( 0.37444994344615f)},
{Q31(-0.60182204677608f), Q31( 0.86779651036123f)}, {Q31(-0.97418588163217f), Q31( 0.96468523666475f)},
{Q31( 0.88461574003963f), Q31( 0.57508405276414f)}, {Q31( 0.05198933055162f), Q31( 0.21269661669964f)},
{Q31(-0.53499621979720f), Q31( 0.97241553731237f)}, {Q31(-0.49429560226497f), Q31( 0.98183865291903f)},
{Q31(-0.98935142339139f), Q31(-0.40249159006933f)}, {Q31(-0.98081380091130f), Q31(-0.72856895534041f)},
{Q31(-0.27338148835532f), Q31( 0.99950922447209f)}, {Q31( 0.06310802338302f), Q31(-0.54539587529618f)},
{Q31(-0.20461677199539f), Q31(-0.14209977628489f)}, {Q31( 0.66223843141647f), Q31( 0.72528579940326f)},
{Q31(-0.84764345483665f), Q31( 0.02372316801261f)}, {Q31(-0.89039863483811f), Q31( 0.88866581484602f)},
{Q31( 0.95903308477986f), Q31( 0.76744927173873f)}, {Q31( 0.73504123909879f), Q31(-0.03747203173192f)},
{Q31(-0.31744434966056f), Q31(-0.36834111883652f)}, {Q31(-0.34110827591623f), Q31( 0.40211222807691f)},
{Q31( 0.47803883714199f), Q31(-0.39423219786288f)}, {Q31( 0.98299195879514f), Q31( 0.01989791390047f)},
{Q31(-0.30963073129751f), Q31(-0.18076720599336f)}, {Q31( 0.99992588229018f), Q31(-0.26281872094289f)},
{Q31(-0.93149731080767f), Q31(-0.98313162570490f)}, {Q31( 0.99923472302773f), Q31(-0.80142993767554f)},
{Q31(-0.26024169633417f), Q31(-0.75999759855752f)}, {Q31(-0.35712514743563f), Q31( 0.19298963768574f)},
{Q31(-0.99899084509530f), Q31( 0.74645156992493f)}, {Q31( 0.86557171579452f), Q31( 0.55593866696299f)},
{Q31( 0.33408042438752f), Q31( 0.86185953874709f)}, {Q31( 0.99010736374716f), Q31( 0.04602397576623f)},
{Q31(-0.66694269691195f), Q31(-0.91643611810148f)}, {Q31( 0.64016792079480f), Q31( 0.15649530836856f)},
{Q31( 0.99570534804836f), Q31( 0.45844586038111f)}, {Q31(-0.63431466947340f), Q31( 0.21079116459234f)},
{Q31(-0.07706847005931f), Q31(-0.89581437101329f)}, {Q31( 0.98590090577724f), Q31( 0.88241721133981f)},
{Q31( 0.80099335254678f), Q31(-0.36851896710853f)}, {Q31( 0.78368131392666f), Q31( 0.45506999802597f)},
{Q31( 0.08707806671691f), Q31( 0.80938994918745f)}, {Q31(-0.86811883080712f), Q31( 0.39347308654705f)},
{Q31(-0.39466529740375f), Q31(-0.66809432114456f)}, {Q31( 0.97875325649683f), Q31(-0.72467840967746f)},
{Q31(-0.95038560288864f), Q31( 0.89563219587625f)}, {Q31( 0.17005239424212f), Q31( 0.54683053962658f)},
{Q31(-0.76910792026848f), Q31(-0.96226617549298f)}, {Q31( 0.99743281016846f), Q31( 0.42697157037567f)},
{Q31( 0.95437383549973f), Q31( 0.97002324109952f)}, {Q31( 0.99578905365569f), Q31(-0.54106826257356f)},
{Q31( 0.28058259829990f), Q31(-0.85361420634036f)}, {Q31( 0.85256524470573f), Q31(-0.64567607735589f)},
{Q31(-0.50608540105128f), Q31(-0.65846015480300f)}, {Q31(-0.97210735183243f), Q31(-0.23095213067791f)},
{Q31( 0.95424048234441f), Q31(-0.99240147091219f)}, {Q31(-0.96926570524023f), Q31( 0.73775654896574f)},
{Q31( 0.30872163214726f), Q31( 0.41514960556126f)}, {Q31(-0.24523839572639f), Q31( 0.63206633394807f)},
{Q31(-0.33813265086024f), Q31(-0.38661779441897f)}, {Q31(-0.05826828420146f), Q31(-0.06940774188029f)},
{Q31(-0.22898461455054f), Q31( 0.97054853316316f)}, {Q31(-0.18509915019881f), Q31( 0.47565762892084f)},
{Q31(-0.10488238045009f), Q31(-0.87769947402394f)}, {Q31(-0.71886586182037f), Q31( 0.78030982480538f)},
{Q31( 0.99793873738654f), Q31( 0.90041310491497f)}, {Q31( 0.57563307626120f), Q31(-0.91034337352097f)},
{Q31( 0.28909646383717f), Q31( 0.96307783970534f)}, {Q31( 0.42188998312520f), Q31( 0.48148651230437f)},
{Q31( 0.93335049681047f), Q31(-0.43537023883588f)}, {Q31(-0.97087374418267f), Q31( 0.86636445711364f)},
{Q31( 0.36722871286923f), Q31( 0.65291654172961f)}, {Q31(-0.81093025665696f), Q31( 0.08778370229363f)},
{Q31(-0.26240603062237f), Q31(-0.92774095379098f)}, {Q31( 0.83996497984604f), Q31( 0.55839849139647f)},
{Q31(-0.99909615720225f), Q31(-0.96024605713970f)}, {Q31( 0.74649464155061f), Q31( 0.12144893606462f)},
{Q31(-0.74774595569805f), Q31(-0.26898062008959f)}, {Q31( 0.95781667469567f), Q31(-0.79047927052628f)},
{Q31( 0.95472308713099f), Q31(-0.08588776019550f)}, {Q31( 0.48708332746299f), Q31( 0.99999041579432f)},
{Q31( 0.46332038247497f), Q31( 0.10964126185063f)}, {Q31(-0.76497004940162f), Q31( 0.89210929242238f)},
{Q31( 0.57397389364339f), Q31( 0.35289703373760f)}, {Q31( 0.75374316974495f), Q31( 0.96705214651335f)},
{Q31(-0.59174397685714f), Q31(-0.89405370422752f)}, {Q31( 0.75087906691890f), Q31(-0.29612672982396f)},
{Q31(-0.98607857336230f), Q31( 0.25034911730023f)}, {Q31(-0.40761056640505f), Q31(-0.90045573444695f)},
{Q31( 0.66929266740477f), Q31( 0.98629493401748f)}, {Q31(-0.97463695257310f), Q31(-0.00190223301301f)},
{Q31( 0.90145509409859f), Q31( 0.99781390365446f)}, {Q31(-0.87259289048043f), Q31( 0.99233587353666f)},
{Q31(-0.91529461447692f), Q31(-0.15698707534206f)}, {Q31(-0.03305738840705f), Q31(-0.37205262859764f)},
{Q31( 0.07223051368337f), Q31(-0.88805001733626f)}, {Q31( 0.99498012188353f), Q31( 0.97094358113387f)},
{Q31(-0.74904939500519f), Q31( 0.99985483641521f)}, {Q31( 0.04585228574211f), Q31( 0.99812337444082f)},
{Q31(-0.89054954257993f), Q31(-0.31791913188064f)}, {Q31(-0.83782144651251f), Q31( 0.97637632547466f)},
{Q31( 0.33454804933804f), Q31(-0.86231516800408f)}, {Q31(-0.99707579362824f), Q31( 0.93237990079441f)},
{Q31(-0.22827527843994f), Q31( 0.18874759397997f)}, {Q31( 0.67248046289143f), Q31(-0.03646211390569f)},
{Q31(-0.05146538187944f), Q31(-0.92599700120679f)}, {Q31( 0.99947295749905f), Q31( 0.93625229707912f)},
{Q31( 0.66951124390363f), Q31( 0.98905825623893f)}, {Q31(-0.99602956559179f), Q31(-0.44654715757688f)},
{Q31( 0.82104905483590f), Q31( 0.99540741724928f)}, {Q31( 0.99186510988782f), Q31( 0.72023001312947f)},
{Q31(-0.65284592392918f), Q31( 0.52186723253637f)}, {Q31( 0.93885443798188f), Q31(-0.74895312615259f)},
{Q31( 0.96735248738388f), Q31( 0.90891816978629f)}, {Q31(-0.22225968841114f), Q31( 0.57124029781228f)},
{Q31(-0.44132783753414f), Q31(-0.92688840659280f)}, {Q31(-0.85694974219574f), Q31( 0.88844532719844f)},
{Q31( 0.91783042091762f), Q31(-0.46356892383970f)}, {Q31( 0.72556974415690f), Q31(-0.99899555770747f)},
{Q31(-0.99711581834508f), Q31( 0.58211560180426f)}, {Q31( 0.77638976371966f), Q31( 0.94321834873819f)},
{Q31( 0.07717324253925f), Q31( 0.58638399856595f)}, {Q31(-0.56049829194163f), Q31( 0.82522301569036f)},
{Q31( 0.98398893639988f), Q31( 0.39467440420569f)}, {Q31( 0.47546946844938f), Q31( 0.68613044836811f)},
{Q31( 0.65675089314631f), Q31( 0.18331637134880f)}, {Q31( 0.03273375457980f), Q31(-0.74933109564108f)},
{Q31(-0.38684144784738f), Q31( 0.51337349030406f)}, {Q31(-0.97346267944545f), Q31(-0.96549364384098f)},
{Q31(-0.53282156061942f), Q31(-0.91423265091354f)}, {Q31( 0.99817310731176f), Q31( 0.61133572482148f)},
{Q31(-0.50254500772635f), Q31(-0.88829338134294f)}, {Q31( 0.01995873238855f), Q31( 0.85223515096765f)},
{Q31( 0.99930381973804f), Q31( 0.94578896296649f)}, {Q31( 0.82907767600783f), Q31(-0.06323442598128f)},
{Q31(-0.58660709669728f), Q31( 0.96840773806582f)}, {Q31(-0.17573736667267f), Q31(-0.48166920859485f)},
{Q31( 0.83434292401346f), Q31(-0.13023450646997f)}, {Q31( 0.05946491307025f), Q31( 0.20511047074866f)},
{Q31( 0.81505484574602f), Q31(-0.94685947861369f)}, {Q31(-0.44976380954860f), Q31( 0.40894572671545f)},
{Q31(-0.89746474625671f), Q31( 0.99846578838537f)}, {Q31( 0.39677256130792f), Q31(-0.74854668609359f)},
{Q31(-0.07588948563079f), Q31( 0.74096214084170f)}, {Q31( 0.76343198951445f), Q31( 0.41746629422634f)},
{Q31(-0.74490104699626f), Q31( 0.94725911744610f)}, {Q31( 0.64880119792759f), Q31( 0.41336660830571f)},
{Q31( 0.62319537462542f), Q31(-0.93098313552599f)}, {Q31( 0.42215817594807f), Q31(-0.07712787385208f)},
{Q31( 0.02704554141885f), Q31(-0.05417518053666f)}, {Q31( 0.80001773566818f), Q31( 0.91542195141039f)},
{Q31(-0.79351832348816f), Q31(-0.36208897989136f)}, {Q31( 0.63872359151636f), Q31( 0.08128252493444f)},
{Q31( 0.52890520960295f), Q31( 0.60048872455592f)}, {Q31( 0.74238552914587f), Q31( 0.04491915291044f)},
{Q31( 0.99096131449250f), Q31(-0.19451182854402f)}, {Q31(-0.80412329643109f), Q31(-0.88513818199457f)},
{Q31(-0.64612616129736f), Q31( 0.72198674804544f)}, {Q31( 0.11657770663191f), Q31(-0.83662833815041f)},
{Q31(-0.95053182488101f), Q31(-0.96939905138082f)}, {Q31(-0.62228872928622f), Q31( 0.82767262846661f)},
{Q31( 0.03004475787316f), Q31(-0.99738896333384f)}, {Q31(-0.97987214341034f), Q31( 0.36526129686425f)},
{Q31(-0.99986980746200f), Q31(-0.36021610299715f)}, {Q31( 0.89110648599879f), Q31(-0.97894250343044f)},
{Q31( 0.10407960510582f), Q31( 0.77357793811619f)}, {Q31( 0.95964737821728f), Q31(-0.35435818285502f)},
{Q31( 0.50843233159162f), Q31( 0.96107691266205f)}, {Q31( 0.17006334670615f), Q31(-0.76854025314829f)},
{Q31( 0.25872675063360f), Q31( 0.99893303933816f)}, {Q31(-0.01115998681937f), Q31( 0.98496019742444f)},
{Q31(-0.79598702973261f), Q31( 0.97138411318894f)}, {Q31(-0.99264708948101f), Q31(-0.99542822402536f)},
{Q31(-0.99829663752818f), Q31( 0.01877138824311f)}, {Q31(-0.70801016548184f), Q31( 0.33680685948117f)},
{Q31(-0.70467057786826f), Q31( 0.93272777501857f)}, {Q31( 0.99846021905254f), Q31(-0.98725746254433f)},
{Q31(-0.63364968534650f), Q31(-0.16473594423746f)}, {Q31(-0.16258217500792f), Q31(-0.95939125400802f)},
{Q31(-0.43645594360633f), Q31(-0.94805030113284f)}, {Q31(-0.99848471702976f), Q31( 0.96245166923809f)},
{Q31(-0.16796458968998f), Q31(-0.98987511890470f)}, {Q31(-0.87979225745213f), Q31(-0.71725725041680f)},
{Q31( 0.44183099021786f), Q31(-0.93568974498761f)}, {Q31( 0.93310180125532f), Q31(-0.99913308068246f)},
{Q31(-0.93941931782002f), Q31(-0.56409379640356f)}, {Q31(-0.88590003188677f), Q31( 0.47624600491382f)},
{Q31( 0.99971463703691f), Q31(-0.83889954253462f)}, {Q31(-0.75376385639978f), Q31( 0.00814643438625f)},
{Q31( 0.93887685615875f), Q31(-0.11284528204636f)}, {Q31( 0.85126435782309f), Q31( 0.52349251543547f)},
{Q31( 0.39701421446381f), Q31( 0.81779634174316f)}, {Q31(-0.37024464187437f), Q31(-0.87071656222959f)},
{Q31(-0.36024828242896f), Q31( 0.34655735648287f)}, {Q31(-0.93388812549209f), Q31(-0.84476541096429f)},
{Q31(-0.65298804552119f), Q31(-0.18439575450921f)}, {Q31( 0.11960319006843f), Q31( 0.99899346780168f)},
{Q31( 0.94292565553160f), Q31( 0.83163906518293f)}, {Q31( 0.75081145286948f), Q31(-0.35533223142265f)},
{Q31( 0.56721979748394f), Q31(-0.24076836414499f)}, {Q31( 0.46857766746029f), Q31(-0.30140233457198f)},
{Q31( 0.97312313923635f), Q31(-0.99548191630031f)}, {Q31(-0.38299976567017f), Q31( 0.98516909715427f)},
{Q31( 0.41025800019463f), Q31( 0.02116736935734f)}, {Q31( 0.09638062008048f), Q31( 0.04411984381457f)},
{Q31(-0.85283249275397f), Q31( 0.91475563922421f)}, {Q31( 0.88866808958124f), Q31(-0.99735267083226f)},
{Q31(-0.48202429536989f), Q31(-0.96805608884164f)}, {Q31( 0.27572582416567f), Q31( 0.58634753335832f)},
{Q31(-0.65889129659168f), Q31( 0.58835634138583f)}, {Q31( 0.98838086953732f), Q31( 0.99994349600236f)},
{Q31(-0.20651349620689f), Q31( 0.54593044066355f)}, {Q31(-0.62126416356920f), Q31(-0.59893681700392f)},
{Q31( 0.20320105410437f), Q31(-0.86879180355289f)}, {Q31(-0.97790548600584f), Q31( 0.96290806999242f)},
{Q31( 0.11112534735126f), Q31( 0.21484763313301f)}, {Q31(-0.41368337314182f), Q31( 0.28216837680365f)},
{Q31( 0.24133038992960f), Q31( 0.51294362630238f)}, {Q31(-0.66393410674885f), Q31(-0.08249679629081f)},
{Q31(-0.53697829178752f), Q31(-0.97649903936228f)}, {Q31(-0.97224737889348f), Q31( 0.22081333579837f)},
{Q31( 0.87392477144549f), Q31(-0.12796173740361f)}, {Q31( 0.19050361015753f), Q31( 0.01602615387195f)},
{Q31(-0.46353441212724f), Q31(-0.95249041539006f)}, {Q31(-0.07064096339021f), Q31(-0.94479803205886f)},
{Q31(-0.92444085484466f), Q31(-0.10457590187436f)}, {Q31(-0.83822593578728f), Q31(-0.01695043208885f)},
{Q31( 0.75214681811150f), Q31(-0.99955681042665f)}, {Q31(-0.42102998829339f), Q31( 0.99720941999394f)},
{Q31(-0.72094786237696f), Q31(-0.35008961934255f)}, {Q31( 0.78843311019251f), Q31( 0.52851398958271f)},
{Q31( 0.97394027897442f), Q31(-0.26695944086561f)}, {Q31( 0.99206463477946f), Q31(-0.57010120849429f)},
{Q31( 0.76789609461795f), Q31(-0.76519356730966f)}, {Q31(-0.82002421836409f), Q31(-0.73530179553767f)},
{Q31( 0.81924990025724f), Q31( 0.99698425250579f)}, {Q31(-0.26719850873357f), Q31( 0.68903369776193f)},
{Q31(-0.43311260380975f), Q31( 0.85321815947490f)}, {Q31( 0.99194979673836f), Q31( 0.91876249766422f)},
{Q31(-0.80692001248487f), Q31(-0.32627540663214f)}, {Q31( 0.43080003649976f), Q31(-0.21919095636638f)},
{Q31( 0.67709491937357f), Q31(-0.95478075822906f)}, {Q31( 0.56151770568316f), Q31(-0.70693811747778f)},
{Q31( 0.10831862810749f), Q31(-0.08628837174592f)}, {Q31( 0.91229417540436f), Q31(-0.65987351408410f)},
{Q31(-0.48972893932274f), Q31( 0.56289246362686f)}, {Q31(-0.89033658689697f), Q31(-0.71656563987082f)},
{Q31( 0.65269447475094f), Q31( 0.65916004833932f)}, {Q31( 0.67439478141121f), Q31(-0.81684380846796f)},
{Q31(-0.47770832416973f), Q31(-0.16789556203025f)}, {Q31(-0.99715979260878f), Q31(-0.93565784007648f)},
{Q31(-0.90889593602546f), Q31( 0.62034397054380f)}, {Q31(-0.06618622548177f), Q31(-0.23812217221359f)},
{Q31( 0.99430266919728f), Q31( 0.18812555317553f)}, {Q31( 0.97686402381843f), Q31(-0.28664534366620f)},
{Q31( 0.94813650221268f), Q31(-0.97506640027128f)}, {Q31(-0.95434497492853f), Q31(-0.79607978501983f)},
{Q31(-0.49104783137150f), Q31( 0.32895214359663f)}, {Q31( 0.99881175120751f), Q31( 0.88993983831354f)},
{Q31( 0.50449166760303f), Q31(-0.85995072408434f)}, {Q31( 0.47162891065108f), Q31(-0.18680204049569f)},
{Q31(-0.62081581361840f), Q31( 0.75000676218956f)}, {Q31(-0.43867015250812f), Q31( 0.99998069244322f)},
{Q31( 0.98630563232075f), Q31(-0.53578899600662f)}, {Q31(-0.61510362277374f), Q31(-0.89515019899997f)},
{Q31(-0.03841517601843f), Q31(-0.69888815681179f)}, {Q31(-0.30102157304644f), Q31(-0.07667808922205f)},
{Q31( 0.41881284182683f), Q31( 0.02188098922282f)}, {Q31(-0.86135454941237f), Q31( 0.98947480909359f)},
{Q31( 0.67226861393788f), Q31(-0.13494389011014f)}, {Q31(-0.70737398842068f), Q31(-0.76547349325992f)},
{Q31( 0.94044946687963f), Q31( 0.09026201157416f)}, {Q31(-0.82386352534327f), Q31( 0.08924768823676f)},
{Q31(-0.32070666698656f), Q31( 0.50143421908753f)}, {Q31( 0.57593163224487f), Q31(-0.98966422921509f)},
{Q31(-0.36326018419965f), Q31( 0.07440243123228f)}, {Q31( 0.99979044674350f), Q31(-0.14130287347405f)},
{Q31(-0.92366023326932f), Q31(-0.97979298068180f)}, {Q31(-0.44607178518598f), Q31(-0.54233252016394f)},
{Q31( 0.44226800932956f), Q31( 0.71326756742752f)}, {Q31( 0.03671907158312f), Q31( 0.63606389366675f)},
{Q31( 0.52175424682195f), Q31(-0.85396826735705f)}, {Q31(-0.94701139690956f), Q31(-0.01826348194255f)},
{Q31(-0.98759606946049f), Q31( 0.82288714303073f)}, {Q31( 0.87434794743625f), Q31( 0.89399495655433f)},
{Q31(-0.93412041758744f), Q31( 0.41374052024363f)}, {Q31( 0.96063943315511f), Q31( 0.93116709541280f)},
{Q31( 0.97534253457837f), Q31( 0.86150930812689f)}, {Q31( 0.99642466504163f), Q31( 0.70190043427512f)},
{Q31(-0.94705089665984f), Q31(-0.29580042814306f)}, {Q31( 0.91599807087376f), Q31(-0.98147830385781f)},
// Start of duplicated table
{Q31(-0.99948153278296f), Q31(-0.59483417516607f)}, {Q31( 0.97113454393991f), Q31(-0.67528515225647f)},
{Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)},
{Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)},
{Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)},
};
#endif /* AVCODEC_AACSBRDATA_H */

Some files were not shown because too many files have changed in this diff Show more