• Frank Barchard's avatar
    ARGBToAR30 use vpmulhuw to replicate fields · 11dd1b95
    Frank Barchard authored
    AR30 is optimized with 3 techniques
    1. vpmulhuw is used to replicate 8 bits to 10 bits.
    2. Two channels are processed at a time.  R and B, and A and G.
    3. vpshufb is used to shift and mask 2 channels of R and B
    
    Red Blue
    With the 8 bit value in the upper bits, vpmulhuw by (1024+4) will produce a 10
    bit value in the low 10 bits of each 16 bit value. This is whats wanted for the
    blue channel. The red needs to be shifted 4 left, so multiply by (1024+4)*16 for
    red.
    
    Alpha Green
    Alpha and Green are already in the high bits so vpand can zero out the other
    bits, keeping just 2 upper bits of alpha and 8 bit green. The same multiplier
    could be used for Green - (1024+4) putting the 10 bit green in the lsb.  Alpha
    would be a simple multiplier to shift it into position.  It wants a gap of 10
    above the green.  Green is 10 bits, so there are 6 bits in the low short.  4
    more are needed, so a multiplier of 4 gets the 2 bits into the upper 16 bits,
    and then a shift of 4 is a multiply of 16, so (4*16) = 64.  Then shift the
    result left 10 to position the A and G channels.
    
    Bug: libyuv:751
    Test: ARGBToAR30_Opt
    Change-Id: Ie4f20dce18203bae7b75acb1fd5232db8a8a4f11
    Reviewed-on: https://chromium-review.googlesource.com/820046
    Commit-Queue: Frank Barchard <fbarchard@chromium.org>
    Reviewed-by: 's avatarCheng Wang <wangcheng@google.com>
    11dd1b95
Name
Last commit
Last update
..
compare.cc Loading commit data...
compare_common.cc Loading commit data...
compare_gcc.cc Loading commit data...
compare_msa.cc Loading commit data...
compare_neon.cc Loading commit data...
compare_neon64.cc Loading commit data...
compare_win.cc Loading commit data...
convert.cc Loading commit data...
convert_argb.cc Loading commit data...
convert_from.cc Loading commit data...
convert_from_argb.cc Loading commit data...
convert_jpeg.cc Loading commit data...
convert_to_argb.cc Loading commit data...
convert_to_i420.cc Loading commit data...
cpu_id.cc Loading commit data...
mjpeg_decoder.cc Loading commit data...
mjpeg_validate.cc Loading commit data...
planar_functions.cc Loading commit data...
rotate.cc Loading commit data...
rotate_any.cc Loading commit data...
rotate_argb.cc Loading commit data...
rotate_common.cc Loading commit data...
rotate_dspr2.cc Loading commit data...
rotate_gcc.cc Loading commit data...
rotate_msa.cc Loading commit data...
rotate_neon.cc Loading commit data...
rotate_neon64.cc Loading commit data...
rotate_win.cc Loading commit data...
row_any.cc Loading commit data...
row_common.cc Loading commit data...
row_dspr2.cc Loading commit data...
row_gcc.cc Loading commit data...
row_msa.cc Loading commit data...
row_neon.cc Loading commit data...
row_neon64.cc Loading commit data...
row_win.cc Loading commit data...
scale.cc Loading commit data...
scale_any.cc Loading commit data...
scale_argb.cc Loading commit data...
scale_common.cc Loading commit data...
scale_dspr2.cc Loading commit data...
scale_gcc.cc Loading commit data...
scale_msa.cc Loading commit data...
scale_neon.cc Loading commit data...
scale_neon64.cc Loading commit data...
scale_win.cc Loading commit data...
video_common.cc Loading commit data...