View Single Post
Old 29th June 2009, 20:38   #16  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
DS, I just had an idea on how to improve the algorithm so that it doesn't, in any case, perform worse than the optimal solution.
The basic idea remains the same, but after calling x264_slicetype_path_search I check if num_bframes is equal to max_bframes and less than param.i_bframe. In this case I set max_bframes back to param.i_bframe (as if it was a scenecut) and call again immediately x264_slicetype_path_search (I know that in this way you'd end up doing the search twice for the same GOP). In this way the decision should be absolutely identical to the non-patched trellis decision. Could it work or am I missing something? Ideally x264_slicetype_path_search itself could be patched so that if it hits the limit it does the reset thing described above without having to do the same search twice - IIRC trellis allows this.
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog
CAFxX is offline   Reply With Quote