Opened 14 years ago

Closed 14 years ago

#968 closed patch (fixed)

Remove harmful "optimization" from AFD::HandleGopStart

Reported by: bolek-mythtv@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

The following code in AvFormatDecoder::HandleGopStart?:

            // Grow positionMap vector several entries at a time
            if (m_positionMap.capacity() == m_positionMap.size())
                m_positionMap.reserve(m_positionMap.size() + 60);
            PosMapEntry entry = {prevgoppos / keyframedist,
                                 prevgoppos, startpos};
            m_positionMap.push_back(entry);

forces the position map to grow by 60 elements whenever it is full. This is not only not neccessary since QValueVector does the right thing already, but it is actually harmful since it introduces quadratic behavior. QValueVector by itself uses the exponential growth algorithm which preserves the linear behavior.

A patch that removes this code is attached.

Attachments (1)

qvaluevector-patch.txt (702 bytes) - added by bolek-mythtv@… 14 years ago.

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by bolek-mythtv@…

Attachment: qvaluevector-patch.txt added

comment:1 Changed 14 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

(In [8547]) Close #968 by applying patch (remove bad manual growing of a qvector).

Note: See TracTickets for help on using tickets.