public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Gcc version affects program execution efficiency
@ 2024-02-27 13:44 abzhou36
  2024-02-27 16:21 ` David Brown
  0 siblings, 1 reply; 2+ messages in thread
From: abzhou36 @ 2024-02-27 13:44 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

Dear Sir or Madam




I used ffmpeg for hardware acceleration of video decoding and compiled ffmpeg using gcc-9.4 on the Ubuntu 20.04 system. 
However, its performance is poor. If gcc-7.5 is used on the same Ubuntu 20.04 system, the decoding performance will be better. 


I analyzed the code of ffmpeg and found that there is a big difference in time consumption when use gcc-9.4 and gcc-7.5 in the following functions:
static int find_marker(const uint_8 **pbuf_ptr, const uint_8 *buf_end)
{
    const uint_8 *buf_ptr;
    unsigned int v, v2;
    int val;
    int skipped = 0;
     
    buf_ptr = *pbuf_ptr;
    while (buf_end - buf_ptr > 1) {
        v = *buf_ptr++;
        v2 = *buf_ptr;
        if (v == 0xff && v2 >= SOFO && v2 <= COM) {
            val = *buf_ptr++;
             goto found;
        }
        skipped++;
    }
    buf_ptr = buf_end;
    val = -1;
found:
    *pbuf_ptr = buf_ptr;
    return val;
}


I want to know why this difference arises and how to solve this problem.


I look forward to your help.


Thanks and Regards.
Aibin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-27 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27 13:44 Gcc version affects program execution efficiency abzhou36
2024-02-27 16:21 ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).