void apply_sao(de265_image* img, int xCtb,int yCtb,
               const slice_segment_header* shdr, int cIdx, int nSW,int nSH,
               const pixel_t* in_img,  int in_stride,
               /* */ pixel_t* out_img, int out_stride)
{
  if (img->high_bit_depth(cIdx)) {
    apply_sao_internal<uint16_t>(img,xCtb,yCtb, shdr,cIdx,nSW,nSH,
                                 (uint16_t*)in_img, in_stride,
                                 (uint16_t*)out_img,out_stride);
  }
  else {
    apply_sao_internal<uint8_t>(img,xCtb,yCtb, shdr,cIdx,nSW,nSH,
                                in_img, in_stride,
                                out_img,out_stride);
  }
}
void apply_sao(de265_image* img, int xCtb,int yCtb,
               const slice_segment_header* shdr, int cIdx, int nSW,int nSH,
               const pixel_t* in_img,  int in_stride,
                 pixel_t* out_img, int out_stride)
{
  if (img->high_bit_depth(cIdx)) {
    apply_sao_internal<uint16_t>(img,xCtb,yCtb, shdr,cIdx,nSW,nSH,
                                 (uint16_t*)in_img, in_stride,
                                 (uint16_t*)out_img,out_stride);
  }
  else {
    apply_sao_internal<uint8_t>(img,xCtb,yCtb, shdr,cIdx,nSW,nSH,
                                in_img, in_stride,
                                out_img,out_stride);
  }
}