PDA

View Full Version : Slow decoding of interlaced x.264


JankS
17th March 2009, 22:29
Hi,

Why it takes so much power to decode interlaced x.264? I cannot get it to work on my P4 2.6 on Quality above 28.

/At the same time interlaced WMV 9 Advanced profile decodes easily with CPU load not exceeding 20%/

LoRd_MuldeR
17th March 2009, 22:42
What H.264 decoder are you using? And what deinterlacer, if any, is used?

BTW: It's h.264, but x264 ;)

JankS
17th March 2009, 23:59
What H.264 decoder are you using? And what deinterlacer, if any, is used?

BTW: It's h.264, but x264 ;)

I am using libavcodec as decoder and no deinterlacer as I am using TV set as output device for video.

LoRd_MuldeR
18th March 2009, 00:07
I am using libavcodec as decoder and no deinterlacer as I am using TV set as output device for video.

Get the latest ffdshow-tryouts (http://ffdshow-tryout.sourceforge.net/download.php) and make sure "ffmpeg-mt" is selected as your decoder.

Alternatively you may try CoreAVC (http://www.coreavc.com/index.php?option=com_content&task=view&id=41&Itemid=59) or DivX 7 (http://www.divx.com/en/downloads/divx/win) as your H.264 decoder...

Adub
18th March 2009, 00:54
Also, what resolution is your source?

Blue_MiSfit
18th March 2009, 03:11
Per my recent thread, Divx H.264 seems to be the most efficient decoder, at least for multiple cores (i.e. 4+). I don't know about single core, and specifically NetBurst (P4) versus Core.

VC-1 has much lower decoding requirements, nobody's arguing about that :) CABAC in particular for H.264 is extremely CPU intensive.

~MiSfit

JankS
18th March 2009, 09:39
Also, what resolution is your source?

Source is 720x576 from mini DV video camera (also interlaced).

JankS
18th March 2009, 09:49
Per my recent thread, Divx H.264 seems to be the most efficient decoder



Can I use Divx H.264 to decode x.264 or Divx H.264 decodes only Divx encoded sources?

lucassp
18th March 2009, 10:00
DivX H.264 Decoder can decode any H.264 stream.

nm
18th March 2009, 10:10
I cannot get it to work on my P4 2.6 on Quality above 28.
What do you mean by "Quality above 28", CRF less than 28 or something else? Are you using some encoding frontend? What kind of average bitrates do you get for the 576i source?

libavcodec should be able to decode 10 Mbps 576i on your CPU, easily, and such a high bitrate would probably be overkill for that resolution.

squid_80
18th March 2009, 11:18
DivX H.264 Decoder can decode any H.264 stream.

Does it handle lossless predictive streams created with x264?

LoRd_MuldeR
18th March 2009, 18:31
Does it handle lossless predictive streams created with x264?

Nope. But CoreAVC does, ffmpge-MT does too.

Can I use Divx H.264 to decode x.264 or Divx H.264 decodes only Divx encoded sources?

There are no "x264" (still no dot in the name ^^) or "DivX H.264" files! There are only H.264 files, no matter which H.264 encoder created them.

Standards, such as H.264, exist for a reason. Any H.264 decoder will decode any valid H.264 stream, as long as it supports the respective Profile/Level ;)

BTW: A recent decoder speed comparison can be found in this (http://forum.doom9.org/showpost.php?p=1262683&postcount=1) thread ...

JankS
18th March 2009, 18:57
What do you mean by "Quality above 28", CRF less than 28 or something else? Are you using some encoding frontend? What kind of average bitrates do you get for the 576i source?

libavcodec should be able to decode 10 Mbps 576i on your CPU, easily, and such a high bitrate would probably be overkill for that resolution.

I am using XviD4PSP encoding frontend. Quality above 28 refers to Quantizer below 28 in constant quality mode. VLC player shows average bitrate 1024kb/s on Q25 576i interlace encoding. This doesn't play without heavy frame drops. Q28 encoding plays by VLC media player which seems fastest but not by WMplayer.
I tried disabling Cabac and B frames - this doesn't help.

LoRd_MuldeR
18th March 2009, 19:01
I am using XviD4PSP encoding frontend. Quality above 28 refers to Quantizer below 28 in constant quality mode. VLC player shows average bitrate 1024kb/s on Q25 576i interlace encoding. This doesn't play without heavy frame drops. Q28 encoding plays by VLC media player which seems fastest but not by WMplayer.
I tried disabling Cabac and B frames - this doesn't help.

Not surprising: Lower quantizers lead to higher bitrates. And the higher the bitrate, the more CPU power is required for playback! Especially with CABAC enabled...

nm
18th March 2009, 19:23
I am using XviD4PSP encoding frontend. Quality above 28 refers to Quantizer below 28 in constant quality mode. VLC player shows average bitrate 1024kb/s on Q25 576i interlace encoding. This doesn't play without heavy frame drops. Q28 encoding plays by VLC media player which seems fastest but not by WMplayer.
If that 1024 kb/s is 1024 kbits/s (not kbytes/s), this sounds strange. Even a 1 GHz P3 should play such files with libavcodec. Could you post a problematic sample clip (at MediaFire, for example)?

JankS
20th March 2009, 08:27
Actual problem was in CPU temperature - I discovered that soon after starting of decoding it reached 90C and kept that level till the end of playback. As I understood at such temperature CPU reduced performance and while even reduced performance was enough for VC-1 and high quantizier progressive H.264 playback it wasn't enough for such heavy task as H.264 interlaced playback.
After fixing this everything now plays smoothly, thanks for help!

benwaggoner
21st March 2009, 17:41
Related question: any rule of thumb for performance differences in decoding interlaced H.264 versus progressive H.264 at the same bitrate? Just the decoder, not including deinterlacing.

Dark Shikari
21st March 2009, 22:18
Related question: any rule of thumb for performance differences in decoding interlaced H.264 versus progressive H.264 at the same bitrate? Just the decoder, not including deinterlacing.PAFF shouldn't be particularly slower. MBAFF may be a lot slower as the logic is simply much more complicated and deblocking on edges between interlaced and progressive macroblocks just becomes a catastrophic mess. Depending on how optimized a decoder is for MBAFF (or not), the difference could be pretty large. The worst case would be a decoder that just defaults to completely unoptimized deblocking code in the case of MBAFF.

akupenguin
22nd March 2009, 03:18
any rule of thumb for performance differences in decoding interlaced H.264 versus progressive H.264 at the same bitrate?
I once benchmarked MBAFF in libavcodec as a 15% speed penalty.

benwaggoner
22nd March 2009, 21:01
PAFF shouldn't be particularly slower. MBAFF may be a lot slower as the logic is simply much more complicated and deblocking on edges between interlaced and progressive macroblocks just becomes a catastrophic mess. Depending on how optimized a decoder is for MBAFF (or not), the difference could be pretty large. The worst case would be a decoder that just defaults to completely unoptimized deblocking code in the case of MBAFF.
Interesting, thanks.

Are the efficiency gains from MBAFF significant enough to make it worth the extra hit?

Of course, I'm sure 99% of interlaced H.264 streams in the world are actually decoded by ASICs in STBs, so in practice there wouldn't be a complexity issue.

JankS
22nd March 2009, 21:41
Interesting, why encoding interlaced with same x.264 settings takes almost +50% of average bitrate compared with progressive? Does it really reflects in quality?

nm
22nd March 2009, 22:41
Interesting, why encoding interlaced with same x.264 settings takes almost +50% of average bitrate compared with progressive?
Are you comparing 25i to deinterlaced 25p? The latter discards part of the information content. How much, depends on the deinterlacing method and the amount of motion within the video. If you would deinterlace (bob) to 50p, it would probably take more space than 25i.

Does it really reflects in quality?
Encode at the same bitrate and see.

benwaggoner
23rd March 2009, 16:28
Are you comparing 25i to deinterlaced 25p? The latter discards part of the information content. How much, depends on the deinterlacing method and the amount of motion within the video. If you would deinterlace (bob) to 50p, it would probably take more space than 25i.
Yes, I'm specifically comparing encoding at 25i with a post-decode bob to 50p versus doing a pre-encode bob to 50p and encoding as 50p.