Ejemplo n.º 1
0
void H264AVCEncoderTest::sbsMux(UChar *output, Int iStrideOut, UChar *input0, UChar *input1, Int iStrideIn, Int width, Int height, Int offset0, Int offset1, Int iFilterIdx)
{
  int j;
  int hwidth = (width >> 1);
  if ( iFilterIdx > 11 )
  {
    ImgProcessFilter1D *flt = create_img_process_filter_1D(iFilterIdx);
    for (j = 0; j < height; j++)
    {
      img_process_filter_even_hor_line( flt, input0+j*iStrideIn +offset0, output+j*iStrideOut,        offset0, width + offset0, flt->c_taps_div2, width - flt->c_taps_div2 + offset0, 2 );
      img_process_filter_even_hor_line( flt, input1+j*iStrideIn +offset1, output+j*iStrideOut+hwidth, offset1, width + offset1, flt->c_taps_div2, width - flt->c_taps_div2 + offset1, 2 );
    }
    destroy_img_process_filter_1D(flt);
  }
  else if ( iFilterIdx > 0 )
  {
    ImgProcessFilter1D *flt = create_img_process_filter_1D(iFilterIdx);
    for (j = 0; j < height; j++)
    {
      img_process_filter_hor_line(flt, input0+j*iStrideIn +offset0, output+j*iStrideOut, offset0, width, flt->c_taps_div2, width-flt->c_taps_div2, 2);
      img_process_filter_hor_line(flt, input1+j*iStrideIn +offset1, output+j*iStrideOut+hwidth, offset1, width, flt->c_taps_div2, width-flt->c_taps_div2, 2);
    }
    destroy_img_process_filter_1D(flt);
  }
  else
  {
    SbSBasic(output, iStrideOut, input0, input1, iStrideIn, width, height, offset0, offset1);
  }
}
Ejemplo n.º 2
0
void H264AVCEncoderTest::tabMux(UChar *output, Int iStrideOut, UChar *input0, UChar *input1, Int iStrideIn, Int width, Int height, Int offset0, Int offset1, Int iFilterIdx)
{
  int j, jj = offset0;
  int hheight = (height >> 1);  

  if ( iFilterIdx > 11 )
  {
    ImgProcessFilter1D *flt = create_img_process_filter_1D(iFilterIdx);
    for (j = 0; j < hheight; j++)
    { 
      img_process_filter_even_vert_line( flt, input0+jj*iStrideIn, output+j*iStrideOut, 0, width, flt->c_taps_div2, height - flt->c_taps_div2 + offset0, 1, jj, iStrideIn, height + offset0 );
      jj += 2;
    }
    jj = offset1;
    for (j = hheight; j < (hheight<<1); j++)
    { 
      img_process_filter_even_vert_line( flt, input1+jj*iStrideIn, output+j*iStrideOut, 0, width, flt->c_taps_div2, height - flt->c_taps_div2 + offset1, 1, jj, iStrideIn, height + offset1 );
      jj += 2;
    }
    for(j=(hheight<<1); j<height; j++)
    {
      memcpy(output+j*iStrideOut, output+((hheight<<1)-1)*iStrideOut, width*sizeof(imgpel));
    }
    destroy_img_process_filter_1D(flt);
  }
  else if (iFilterIdx > 0)
  {
    ImgProcessFilter1D *flt = create_img_process_filter_1D(iFilterIdx);
    for (j = 0; j < hheight; j++)
    { 
      img_process_filter_vert_line(flt, input0+jj*iStrideIn, output+j*iStrideOut, 0, width, flt->c_taps_div2, height-flt->c_taps_div2, 1, jj, iStrideIn, height);
      jj += 2;
    }
    jj = offset1;
    for (j = hheight; j < (hheight<<1); j++)
    { 
      img_process_filter_vert_line(flt, input1+jj*iStrideIn, output+j*iStrideOut, 0, width, flt->c_taps_div2, height-flt->c_taps_div2, 1, jj, iStrideIn, height);
      jj += 2;
    }
    for(j=(hheight<<1); j<height; j++)
    {
      memcpy(output+j*iStrideOut, output+((hheight<<1)-1)*iStrideOut, width*sizeof(imgpel));
    }
    destroy_img_process_filter_1D(flt);
  }
  else
  {
    TaBBasic(output, iStrideOut, input0, input1, iStrideIn, width, height, offset0, offset1);
  }
}