• Urvang Joshi's avatar
    Cleanup some fragile aspects of rd_pick_partition. · 00c6e6f7
    Urvang Joshi authored
    (1) Explicitly reset RD stats for each partition.
    
    Earlier,
    PARTITION_SPLIT was the only one resetting the RD_STATS in 'sum_rdc'.
    
    But this was working because:
    - PARTITION_SPLIT was tried before VERT, HORZ, VERT_4 and HORZ_4; and
    - RD cost calculations in VERT, HORZ, VERT_4 and HORZ_4 partitions
    implicitly discarded existing value in sum_rdc
    
    However, that was very fragile; explicitly resetting the stats every
    time is much safer.
    
    (2) Using a separate variable 'temp_best_rd_cost' was fragile as someone
    may forget to update the same. So, we use best_rdc.rdcost directly.
    
    BUG=aomedia:1246
    
    Change-Id: Icd75f25c34bb0f1806e691784648bcffce2417e6
    00c6e6f7
encodeframe.c 182 KB