[FFmpeg-devel] [PATCH] Optimize QTRLE encoding

Alexis Ballier alexis.ballier at gmail.com
Thu Feb 14 20:00:11 CET 2013


>From my understanding of your code, the algorithm seems correct and
optimal; thanks, I feel ashamed of not having thought of this before
:=)

just some style remarks:

+    // Initial values

please keep the ansi style type of comments (/* */) as in the rest of
the file (several occurences)

+    lowest_cost = INT_MAX;
+    lowest_cost_index = width;
+    sec_lowest_cost = INT_MAX;
+    sec_lowest_cost_index = width;

please name them lowest_bulk_cost, lowest_bulk_cost_index, etc. so
that their meaning is clear

+        int base_cost, prev_cost;

ditto: base_bulk_cost
the second one I'd name it: bulk_one_total_cost or something that
makes it clear its the total cost we get if we bulk copy only one
pixel

+        int limit;

bulk_limit maybe; it was named limit before because it was only in the
scope of the bulk search branch :)

+        // If our lowest cost index is too far away, replace it
+        // with the next lowest cost

add "bulk" where needed to make it clear you are looking for best bulk
cost (ditto for other comments)


More information about the ffmpeg-devel mailing list