Log in

View Full Version : question about actual reference fram utilization...


ellesshoo
13th November 2007, 18:11
I think I read somewhere that although you set, say 4 or 5 reference frames, most of the time only 1 or 2 are ever referenced. Is this true? I know it depends on the video, so I'm specifically referring to sports in my case. Would cutting down from 4-5 ref frames to 2 speed up x.264 encoding with minimal quality loss? Using 1080i HDTV as my source, resizing to 1024x576, it takes FOREVER. I'm pretty sure there are some settings that I have that are just a waste of processing that have little to no affect on quality. If the thing is only going to reference 3 or 4 frames a few times throughout an entire game, it seems that would cut down on encoding time... What about b-frames, is 3 overkill for sports?

I'm pretty new and don't fully understand what kind of affect some settings actually have on quality vs speed even after reading brief summaries of each setting.

burfadel
13th November 2007, 20:59
It depends on the sport, but with a constantly moving picture more reference frames just introduces more workload for the search functions (from what I understand). A high number of reference frames shines with animation, particularly 'flat' animation such as family guy.

B-frames are adaptive (as long as adaptive b-frames is set), therefore only the number of b-frames required to encode the picture efficiently is used. You can adjust the bias of the selection of whether to use b-franes, to either use more or use less than standard. I find a value of around 40 the most efficient for the bias, although that is a different argument in itself. Basically setting to 16 is fine, 16 will hardly ever be used but it gives the encoder full range to work with.

Encoding a source that has large amounts of motion, even when its resized to 1024x576, will be slow. If you cut the settings back for speed, it will be a sacrifice to quality if a set bitrate is used (or ABR) or file size if constant quality is used.

Dark Shikari
13th November 2007, 21:18
It'll show the reference frame utilization for P and B-frames in the output when you're done encoding.

You are right that older frames are less-often used; this is the idea behind my Fast-Ref-Search.

Sagekilla
14th November 2007, 01:13
As burfadel said, setting --bframes to 16 will not hugely impact encoding speed at all, in fact it will sometimes increase speed (and quality, since they tend to be smaller = more bitrate for other frames) by a small amount since B-frames tend to be easier to encode. The difference you get from using either 3 or 16 B's will vary from source to source, but it really is best to just enable them all to let the encoder pick what's best.

As for other speed ups you can do, you can try posting your settings and we can give you some suggestions to what can help out. But remember, when you're working with a high resolution like 1024x576 it's always going to be slow unless you have a quad core or highly overclocked Core 2 Duo.

Hope that helps! :)

ellesshoo
15th November 2007, 05:01
Currently I don't have the time to play with the settings. I'll try again soon. Do you all know of a "guide" or some sort of reference that deals with settings for sports, in my case it's American Football but I imagine the amount of motion and camera work is very similar to the "other" football or really any sport played on a large surface with people running around. I've briefly tried to search and can't come up with anything.

Also, I scaled the resolution back. It was way too large (yall were right). I simply don't know enough about the impact, benefits, trade-offs, etc all the settings have. I was hoping someone had some good presets for sports (someone that understood what worked best for sports). To be honest, I only have a minimal understanding of what a b-frame or reference frame is... much less all the other stuff.

Dark Shikari
15th November 2007, 06:15
To be honest, I only have a minimal understanding of what a b-frame or reference frame is... much less all the other stuff.
B-frames are frames that:

a) Are not referenced by other frames, so all quality loss is localized to the frame (low quality isn't propagated to future frames). There is a small exception to this but it isn't very important.
b) Are higher quantizer, that is, lower quality (and so smaller bit-wise). This is possible because of a); since lower quality doesn't propagate, it can afford to lose detail.
c) Allows for much more efficient coding in cases of uniform motion (motion doesn't change much between frame X and frame X+2, so frame X+1 can be a very efficiently coded B-frame).

Reference frames are frames that can be looked at to find blocks for motion estimation; that is, frame X can look at a certain number of previous non-B-frames to find the best frame to grab its block from for maximum quality. More reference frames is always better, but past 4-6 its not particularly useful except in the case of animation, where repetitive motion is common.

Sagekilla
15th November 2007, 06:37
As of yet there isn't any (At least I haven't found any yet) comprehensive guides that show the quality benefit and speed loss from enabling options. But, I can tell you that it will help if you post your settings so we can perhaps suggest a good balance between quality and speed for you.

Dark Shikari
15th November 2007, 07:10
As of yet there isn't any (At least I haven't found any yet) comprehensive guides that show the quality benefit and speed loss from enabling options.
This is basically impossible due to the incredible dependence this has on the source.

For example, if I recall correctly I have some sources that benefit over 25% from RDO. On the other hand, I have sources that benefit 2% from it...

audyovydeo
15th November 2007, 09:03
I'm pretty new and don't fully understand what kind of affect some settings actually have on quality vs speed even after reading brief summaries of each setting.

What sports ? field events with large swathes of green with tiny coloured lumps chasing a tiny ball, or motor sports or whatever ?

You didn't post your settings.
Personally I've come to use 3 ref frames as a maximum.
I have a low-end Core2Duo and am constantly looking for a speed/quality tradeoff. My favourite settings are :

--ref 3 --me hex --subme 5 --trellis 1

For an explanation on how I got here, I've put up just yesterday my own x264 page (http://mapage.noos.fr/manamba/x264/manambas_x264_page.html).


cheers
audyovydeo