title: NEON assembly code, how to convert BYTE to float?
body: <p>now i have a code want to improve. the datatype of src data is byte. i want to calculate with float and store the result to byte. but i dont know how to convert datatype of data bwtween BYTE and float. I develop on Android NDK. the C++ code i want to improve followed:</p>
  
  <pre><code>void DoEffect(BYTE *pSrc, float rat){
  //image data:BGRA
  float red, green, blue;
  red = pSrc[RED_CHANNEL] * rat;
  green = pSrc[GREEN_CHANNEL] * rat;
  blue = pSrc[BLUE_CHANNEL] * rat;
  
  //  some step to calculate the result;
  //  red = ...
  //  ...
  //
  
  pSrc[RED_CHANNEL] = (BYTE)red;
  pSrc[GREEN_CHANNEL] = (BYTE)green;
  pSrc[BLUE_CHANNEL] = (BYTE)blue;
  </code></pre>
  
  <p>}</p>
  
  <p>and my neon asm code:</p>
  
  <pre><code>void DoEffect_neon_asm(BYTE *pSrc, float rat){
  __asm__ __volatile__(
          "vld4.8     {d0-d3},[%[src]]    \n"
          "vdupq.32   {d4, d5}, [%[rat]]  \n"
          "# convert src data to float?       \n"
          "code: convert byte to float        \n"
          "# calculate result         \n"
          "..                 \n"
          "# convert result to byte       \n"
          "code: convert float to byte        \n"
          :[src]"r"(pSrc), [rat]"r"(rat)
  );
  </code></pre>
  
  <p>}</p>
  
  <p>my problem is how to code "code: convert byte to float" and "code: convert float to byte" listed in "neon asm code".</p>