Opened 13 years ago

Closed 13 years ago

#1094 closed patch (fixed)

Better Huffman2 implementation

Reported by: nooneimprt4nt@… Owned by: danielk
Priority: minor Milestone: 0.20
Component: dvb Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This is an improved Huffman2 decoding implementation. It uses much less CPU load than the current implementation, which is actually noticable (~70% CPU usage down to ~50%) when processing the EIT from my provider.

Attachments (2)

eit-fasthuff.diff (66.9 KB) - added by nooneimprt4nt@… 13 years ago.
eit-fasthuff.2.diff (66.9 KB) - added by nooneimprt4nt@… 13 years ago.
change uint8_t to unsigned char for compile issue

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by nooneimprt4nt@…

Attachment: eit-fasthuff.diff added

comment:1 Changed 13 years ago by anonymous

The patch applied cleanly, but I get the following error, compiling

In file included from siparser.cpp:15:
atsc_huffman.h:638: error: syntax error before `[' token
atsc_huffman.h:768: error: syntax error before `[' token
siparser.cpp: In member function `void SIParser::ParseDVBEIT(unsigned int,
   tablehead_t*, uint8_t*, unsigned int)':
siparser.cpp:1513: warning: comparison between signed and unsigned integer
   expressions
siparser.cpp: In member function `int SIParser::Huffman2ToQString(uint8_t*,
   int, int, QString&)':
siparser.cpp:2838: error: `Huff2Lookup128' undeclared (first use this function)
siparser.cpp:2838: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
siparser.cpp:2845: error: `Huff2Lookup256' undeclared (first use this function)
make[2]: *** [siparser.o] Error 1
make[2]: Leaving directory `/root/mythtv/trunk/mythtv/libs/libmythtv'
make[1]: *** [sub-libmythtv] Error 2
make[1]: Leaving directory `/root/mythtv/trunk/mythtv/libs'
make: *** [sub-libs] Error 2


comment:2 Changed 13 years ago by nooneimprt4nt@…

maybe uint8_t isn't defined at the point when atsc_huffman.h is loaded?

can you try swapping the uint8_t with 'unsigned char' in atsc_huffman.h. If that works, I'll update the patch, though I have no idea why it doesn't work for you, compiles without warnings on my gcc 4.03 system

comment:3 Changed 13 years ago by anonymous

changing to unsigned char allowed the compile to complete

thanks

Changed 13 years ago by nooneimprt4nt@…

Attachment: eit-fasthuff.2.diff added

change uint8_t to unsigned char for compile issue

comment:4 Changed 13 years ago by danielk

Resolution: fixed
Status: newclosed

(In [8943]) Closes #1094, by applying modified patch.

This changes to a faster huffman decoding algorithm for ATSC EIT data.

I also added some const correctness and formatting fixes to the patch, mostly to make it easier to move these functions as part of #1035.

Note: See TracTickets for help on using tickets.