]> git.sesse.net Git - ffmpeg/commit
avformat/mpegts: cache PID discard values
authorMarton Balint <cus@passwd.hu>
Wed, 23 Jan 2019 00:28:26 +0000 (01:28 +0100)
committerMarton Balint <cus@passwd.hu>
Mon, 4 Feb 2019 20:43:30 +0000 (21:43 +0100)
commit56c58b99d0670c8baff64b8b35bc06c9a9f35ef8
tree76625f2e3fb160b956ac15f157818eab421d92af
parent1eb6bfbc1ff5d9f670ae51b4ca41d0053a6fd486
avformat/mpegts: cache PID discard values

discard_pid can be quite expensive, so let's cache it and recalculate it on
every packet start.

ffmpeg -y -i samples/MPEG-VOB/sdtv/RAI.ts -c copy -map 0:v:0 -map 0:a:0 -f mpegts /dev/null

Before:
   1685 decicycles in handle_packet,  523483 runs,    805 skips

After:
    883 decicycles in handle_packet,  523505 runs,    783 skips

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/mpegts.c