Ejemplo n.º 1
0
static void
gst_dtsdec_class_init (GstDtsDecClass * klass)
{
  GObjectClass *gobject_class;
  GstElementClass *gstelement_class;
  guint cpuflags;

  gobject_class = (GObjectClass *) klass;
  gstelement_class = (GstElementClass *) klass;

  gobject_class->set_property = gst_dtsdec_set_property;
  gobject_class->get_property = gst_dtsdec_get_property;

  gstelement_class->change_state = gst_dtsdec_change_state;

  g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC,
      g_param_spec_boolean ("drc", "Dynamic Range Compression",
          "Use Dynamic Range Compression", FALSE, G_PARAM_READWRITE));

  oil_init ();

  klass->dts_cpuflags = 0;
  cpuflags = oil_cpu_get_flags ();
  if (cpuflags & OIL_IMPL_FLAG_MMX)
    klass->dts_cpuflags |= MM_ACCEL_X86_MMX;
  if (cpuflags & OIL_IMPL_FLAG_3DNOW)
    klass->dts_cpuflags |= MM_ACCEL_X86_3DNOW;
  if (cpuflags & OIL_IMPL_FLAG_MMXEXT)
    klass->dts_cpuflags |= MM_ACCEL_X86_MMXEXT;

  GST_LOG ("CPU flags: dts=%08x, liboil=%08x", klass->dts_cpuflags, cpuflags);
}
Ejemplo n.º 2
0
int main (int argc, char *argv[])
{
  OilFunctionClass *klass;
  int i;
  int n;

  oil_init ();

  n = oil_class_get_n_classes ();
  for (i=0;i<n; i++ ){
    klass = oil_class_get_by_index(i);

    if(klass->prototype) {
      OilPrototype *proto;
      char *string;

      proto = oil_prototype_from_string (klass->prototype);
      if (proto == NULL) {
        printf ("ERROR bad prototype for %s\n", klass->name);
        continue;
      }

      string = oil_prototype_to_string (proto);

      printf("%s (%s)\n", klass->name, string);

      oil_prototype_free (proto);
      free(string);
    } else {
      printf("ERROR no prototype for %s\n", klass->name);
    }
  }

  return 0;
}
Ejemplo n.º 3
0
int
main (int argc, char *argv[])
{
  oil_init();

  oil_print_all ();

  return 0;
}
Ejemplo n.º 4
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  GST_DEBUG_CATEGORY_INIT (goom_debug, "glbgoom", 0, "glbgoom visualisation element");

  oil_init ();

  return gst_element_register (plugin, "glbgoom", GST_RANK_NONE, GST_TYPE_GOOM);
}
Ejemplo n.º 5
0
int
main (int argc, char *argv[])
{
  oil_debug_set_print_function (_debug_print_valist);

  oil_init();

  oil_print_all ();

  return 0;
}
Ejemplo n.º 6
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  oil_init ();

  GST_DEBUG_CATEGORY_INIT (video_test_src_debug, "videotestsrc", 0,
      "Video Test Source");

  return gst_element_register (plugin, "videotestsrc", GST_RANK_NONE,
      GST_TYPE_VIDEO_TEST_SRC);
}
Ejemplo n.º 7
0
static gboolean
plugin_init (GstPlugin * plugin)
{
#ifdef HAVE_LIBOIL
  oil_init ();
#endif

  if (!gst_library_load ("gstvideofilter"))
    return FALSE;

  return gst_element_register (plugin, "puzzle", GST_RANK_NONE,
      GST_TYPE_PUZZLE);
}
Ejemplo n.º 8
0
int main (int argc, char *argv[])
{
    oil_init ();

    test();
    
    if(assert_failed)
      std_log(LOG_FILENAME_LINE,"Test Failed");
    else
      std_log(LOG_FILENAME_LINE,"Test Successful");
    
    create_xml(0);
    return 0;
}
Ejemplo n.º 9
0
static gboolean
plugin_init (GstPlugin * plugin)
{
  GST_DEBUG_CATEGORY_INIT (deinterlace2_debug, "deinterlace2", 0,
      "Deinterlacer");

  oil_init ();

  if (!gst_element_register (plugin, "deinterlace2", GST_RANK_NONE,
          GST_TYPE_DEINTERLACE2)) {
    return FALSE;
  }

  return TRUE;
}
Ejemplo n.º 10
0
int main (int argc, char *argv[])
{
  OilFunctionClass *klass;
  OilFunctionImpl *impl;
  OilTest *test;
  double ave, std;
  int n;

  oil_init ();

  if (argc < 2) {
    printf("oil-test <class_name>\n");
    exit(0);
  }

  klass = oil_class_get (argv[1]);
  if (klass == NULL) {
    printf("class not found: %s\n", argv[1]);
    exit(0);
  }
  oil_class_optimize (klass);

  for (n = 0; n < 200; n+=1) {
    printf("%d", n);

    test = oil_test_new(klass);
    oil_test_set_iterations(test, 10);
    test->n = n;
    test->m = 10;

    impl = klass->reference_impl;
    ave = impl->profile_ave;
    std = impl->profile_std;
    oil_test_check_impl (test, impl);

    for (impl = klass->first_impl; impl; impl = impl->next) {
      if (oil_impl_is_usable (impl)) {
        oil_test_check_impl (test, impl);
        //printf(" %g %g", test->profile_ave, test->profile_std);
        printf(" %g", test->profile_ave);
      }
    }
    printf("\n");
  }

  return 0;
}
Ejemplo n.º 11
0
int main ()
{
  std_log(LOG_FILENAME_LINE,"Test started testsuite_sad8x8");
  oil_init ();
  
  std_log(LOG_FILENAME_LINE,"test_sad12xn_u8");
  test_sad12xn_u8();
  
  std_log(LOG_FILENAME_LINE,"oil_sad12xn_12x12_u8");
  test_sad12xn_12x12_u8();
  
  std_log(LOG_FILENAME_LINE,"oil_sad16xn_u8");
  test_sad16xn_u8();
  
  std_log(LOG_FILENAME_LINE,"oil_sad16xn_16x16_u8");
  test_sad16xn_16x16_u8(); 

  std_log(LOG_FILENAME_LINE,"oil_sad8xn_u8");
  test_sad8xn_u8();
  
  std_log(LOG_FILENAME_LINE,"oil_sad8xn_8x8_u8");
  test_sad8xn_8x8_u8(); 

  std_log(LOG_FILENAME_LINE,"oil_sad8x8_s16");
  test_sad8x8_s16(); 

  std_log(LOG_FILENAME_LINE,"oil_sad8x8_s16_2");
  test_sad8x8_s16_2();
  
  std_log(LOG_FILENAME_LINE,"oil_sad8x8_f64");
  test_sad8x8_f64();
  
  std_log(LOG_FILENAME_LINE,"oil_sad8x8_f64_2");
  test_sad8x8_f64_2();  
  
  std_log(LOG_FILENAME_LINE,"oil_sad8x8_u8_avg");
  test_sad8x8_u8_avg();
  
  
  if(assert_failed)
         std_log(LOG_FILENAME_LINE,"Test Fail");
  else
         std_log(LOG_FILENAME_LINE,"Test Successful");
   
  create_xml(0);
  return 0;
}
Ejemplo n.º 12
0
int main()
    {
    std_log(LOG_FILENAME_LINE,"Test started testsuite_misc8x8");
    oil_init ();

    std_log(LOG_FILENAME_LINE,"oil_clipconv8x8_u8_s16");
    test_clipconv8x8_u8_s16(); 

    std_log(LOG_FILENAME_LINE,"oil_dequantize8x8_s16");
    test_dequantize8x8_s16();
      
    if(assert_failed)
           std_log(LOG_FILENAME_LINE,"Test Fail");
    else
           std_log(LOG_FILENAME_LINE,"Test Successful");
    create_xml(0);
    return 0;
    }
Ejemplo n.º 13
0
int
main (int argc, char *argv[])
{
  oil_init();

  if (argc > 1) {
    int i;
    for (i = 1; i < argc; i++) {
      OilFunctionClass *klass = oil_class_get (argv[i]);
      if (!klass) {
	printerr ("error: no class \"%s\" found\n", argv[i]);
      } else {
	oil_print_class (klass, 1);
      }
    }
  } else {
    oil_print_all ();
  }

  return retval;
}
Ejemplo n.º 14
0
int main (int argc, char *argv[])
{
    int16_t data[64], datatmp[64];
    int i, failed = 0;

    oil_init();

    for (i = 0; i < 64; i++)
        data[i] = i;

    oil_zigzag8x8_s16(datatmp, 8 * sizeof(int16_t), data, 8 * sizeof(int16_t));
    oil_unzigzag8x8_s16(data, 8 * sizeof(int16_t), datatmp, 8 * sizeof(int16_t));

    for (i = 0; i < 64; i++) {
        if (data[i] != i) {
            printf("entry %d was %d, should have been %d\n", i, data[i], i);
            failed = 1;
        }
    }

    return failed;
}
Ejemplo n.º 15
0
int main()
    {
    std_log(LOG_FILENAME_LINE,"Test started testsuite_yuv2rgb8x8");
    oil_init ();

    std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_u8");
    test_yuv2rgbx_u8(); 
    
    std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub2_u8");
    test_yuv2rgbx_sub2_u8(); 
    
    std_log(LOG_FILENAME_LINE,"oil_yuv2rgbx_sub4_u8");
    test_yuv2rgbx_sub4_u8(); 

      
    if(assert_failed)
           std_log(LOG_FILENAME_LINE,"Test Fail");
    else
           std_log(LOG_FILENAME_LINE,"Test Successful");
    create_xml(0);
    return 0;
    }
Ejemplo n.º 16
0
static void
gst_video_balance_class_init (gpointer g_class, gpointer class_data)
{
  GObjectClass *gobject_class;
  GstBaseTransformClass *trans_class;

  gobject_class = G_OBJECT_CLASS (g_class);
  trans_class = GST_BASE_TRANSFORM_CLASS (g_class);

  parent_class = g_type_class_peek_parent (g_class);

  gobject_class->set_property = gst_video_balance_set_property;
  gobject_class->get_property = gst_video_balance_get_property;

  g_object_class_install_property (gobject_class, PROP_CONTRAST,
      g_param_spec_double ("contrast", "Contrast", "contrast",
          0.0, 2.0, DEFAULT_PROP_CONTRAST, G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class, PROP_BRIGHTNESS,
      g_param_spec_double ("brightness", "Brightness", "brightness",
          -1.0, 1.0, DEFAULT_PROP_BRIGHTNESS, G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class, PROP_HUE,
      g_param_spec_double ("hue", "Hue", "hue",
          -1.0, 1.0, DEFAULT_PROP_HUE, G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class, PROP_SATURATION,
      g_param_spec_double ("saturation", "Saturation", "saturation",
          0.0, 2.0, DEFAULT_PROP_SATURATION, G_PARAM_READWRITE));

  gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_video_balance_finalize);

  trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_balance_set_caps);
  trans_class->transform_ip =
      GST_DEBUG_FUNCPTR (gst_video_balance_transform_ip);

#ifdef HAVE_LIBOIL
  oil_init ();
#endif
}
Ejemplo n.º 17
0
int main (int argc, char *argv[])
{
  OilFunctionClass *klass;
  OilFunctionImpl *impl;
  OilTest *test;
  int i;
  int n;
  int j;
  int ret;
  unsigned int cpu_flags;
  //xmlfile = "stride";
  std_log(LOG_FILENAME_LINE, "Test Started testsuite_stride");

  if (argc > 1 && strcmp(argv[1],"-v") == 0) {
    verbose = 1;
  }
  oil_init ();

  cpu_flags = oil_cpu_get_flags ();
  n = oil_class_get_n_classes ();
  
  for (i=0;i<n; i++ )
  {
      klass = oil_class_get_by_index(i);
      std_log(LOG_FILENAME_LINE,"Class Name %s %d\n",klass->name, i);

      test = oil_test_new (klass);

      if (test == NULL) 
      {
          std_log(LOG_FILENAME_LINE,"class \"%s\" has  bad prototype\n", klass->name);
          assert_failed = fail = 1; 
          continue;
      }
      oil_test_set_iterations (test, 1);
      test->n = 1 + oil_rand_u8();
      test->m = 1 + oil_rand_u8();

      std_log(LOG_FILENAME_LINE, "ref impl %s",klass->reference_impl->name);
      oil_test_check_impl (test, klass->reference_impl);        //Testing whether an appropriate implementation is suitable or not
                                                                //Runs the testing procedure described by test on the implementation impl
      
      for(j=0;j<OIL_ARG_LAST;j++)
      {
          if (test->params[j].is_stride) 
          {
              test->params[j].value += oil_type_sizeof(test->params[j].type) *
              (oil_rand_u8()&0xf);
          }
      }
      test->inited = 0;

      for (impl = klass->first_impl; impl; impl = impl->next) 
      {
          std_log(LOG_FILENAME_LINE,"  %s\n", impl->name);
          if ((impl->flags & OIL_CPU_FLAG_MASK) & ~cpu_flags){
              std_log(LOG_FILENAME_LINE, "Not supported");
          } 
          else 
          {
              ret = oil_test_check_impl (test, impl);
              if (!ret) 
              {
                  assert_failed = fail = 1;
                  oil_test_free (test);
                  std_log(LOG_FILENAME_LINE, "Test Failed");
                  create_xml(1);
                  return fail;
              }
              
          }
          
      }

      oil_test_free (test);
  }
  
  if(assert_failed)
      std_log(LOG_FILENAME_LINE,"Test Fail");
  else
      std_log(LOG_FILENAME_LINE,"Test Successful");
  create_xml(0);
  return fail;
}
Ejemplo n.º 18
0
void
gst_video_mixer_init_blend (void)
{
  guint cpu_flags;

  oil_init ();
  cpu_flags = oil_cpu_get_flags ();

  gst_video_mixer_blend_argb = blend_argb_c;
  gst_video_mixer_blend_bgra = blend_bgra_c;
  gst_video_mixer_blend_i420 = blend_i420_c;
  gst_video_mixer_blend_y444 = blend_y444_c;
  gst_video_mixer_blend_y42b = blend_y42b_c;
  gst_video_mixer_blend_y41b = blend_y41b_c;
  gst_video_mixer_blend_rgb = blend_rgb_c;
  gst_video_mixer_blend_xrgb = blend_xrgb_c;
  gst_video_mixer_blend_yuy2 = blend_yuy2_c;

  gst_video_mixer_fill_checker_argb = fill_checker_argb_c;
  gst_video_mixer_fill_checker_bgra = fill_checker_bgra_c;
  gst_video_mixer_fill_checker_ayuv = fill_checker_ayuv_c;
  gst_video_mixer_fill_checker_i420 = fill_checker_i420_c;
  gst_video_mixer_fill_checker_y444 = fill_checker_y444_c;
  gst_video_mixer_fill_checker_y42b = fill_checker_y42b_c;
  gst_video_mixer_fill_checker_y41b = fill_checker_y41b_c;
  gst_video_mixer_fill_checker_rgb = fill_checker_rgb_c;
  gst_video_mixer_fill_checker_xrgb = fill_checker_xrgb_c;
  gst_video_mixer_fill_checker_yuy2 = fill_checker_yuy2_c;
  gst_video_mixer_fill_checker_uyvy = fill_checker_uyvy_c;

  gst_video_mixer_fill_color_argb = fill_color_argb_c;
  gst_video_mixer_fill_color_bgra = fill_color_bgra_c;
  gst_video_mixer_fill_color_abgr = fill_color_abgr_c;
  gst_video_mixer_fill_color_rgba = fill_color_rgba_c;
  gst_video_mixer_fill_color_ayuv = fill_color_ayuv_c;
  gst_video_mixer_fill_color_i420 = fill_color_i420_c;
  gst_video_mixer_fill_color_yv12 = fill_color_yv12_c;
  gst_video_mixer_fill_color_y444 = fill_color_y444_c;
  gst_video_mixer_fill_color_y42b = fill_color_y42b_c;
  gst_video_mixer_fill_color_y41b = fill_color_y41b_c;
  gst_video_mixer_fill_color_rgb = fill_color_rgb_c;
  gst_video_mixer_fill_color_bgr = fill_color_bgr_c;
  gst_video_mixer_fill_color_xrgb = fill_color_xrgb_c;
  gst_video_mixer_fill_color_xbgr = fill_color_xbgr_c;
  gst_video_mixer_fill_color_rgbx = fill_color_rgbx_c;
  gst_video_mixer_fill_color_bgrx = fill_color_bgrx_c;
  gst_video_mixer_fill_color_yuy2 = fill_color_yuy2_c;
  gst_video_mixer_fill_color_yvyu = fill_color_yvyu_c;
  gst_video_mixer_fill_color_uyvy = fill_color_uyvy_c;

#ifdef BUILD_X86_ASM
  if (cpu_flags & OIL_IMPL_FLAG_MMX) {
    gst_video_mixer_blend_argb = blend_argb_mmx;
    gst_video_mixer_blend_bgra = blend_bgra_mmx;
    gst_video_mixer_blend_i420 = blend_i420_mmx;
    gst_video_mixer_blend_y444 = blend_y444_mmx;
    gst_video_mixer_blend_y42b = blend_y42b_mmx;
    gst_video_mixer_blend_y41b = blend_y41b_mmx;
    gst_video_mixer_blend_rgb = blend_rgb_mmx;
    gst_video_mixer_blend_xrgb = blend_xrgb_mmx;
    gst_video_mixer_blend_yuy2 = blend_yuy2_mmx;

    gst_video_mixer_fill_checker_i420 = fill_checker_i420_mmx;
    gst_video_mixer_fill_checker_y444 = fill_checker_y444_mmx;
    gst_video_mixer_fill_checker_y42b = fill_checker_y42b_mmx;
    gst_video_mixer_fill_checker_y41b = fill_checker_y41b_mmx;

    gst_video_mixer_fill_color_argb = fill_color_argb_mmx;
    gst_video_mixer_fill_color_bgra = fill_color_bgra_mmx;
    gst_video_mixer_fill_color_abgr = fill_color_abgr_mmx;
    gst_video_mixer_fill_color_rgba = fill_color_rgba_mmx;
    gst_video_mixer_fill_color_ayuv = fill_color_ayuv_mmx;
    gst_video_mixer_fill_color_i420 = fill_color_i420_mmx;
    gst_video_mixer_fill_color_yv12 = fill_color_yv12_mmx;
    gst_video_mixer_fill_color_y444 = fill_color_y444_mmx;
    gst_video_mixer_fill_color_y42b = fill_color_y42b_mmx;
    gst_video_mixer_fill_color_y41b = fill_color_y41b_mmx;
    gst_video_mixer_fill_color_xrgb = fill_color_xrgb_mmx;
    gst_video_mixer_fill_color_xbgr = fill_color_xbgr_mmx;
    gst_video_mixer_fill_color_rgbx = fill_color_rgbx_mmx;
    gst_video_mixer_fill_color_bgrx = fill_color_bgrx_mmx;
  }
#endif
}
Ejemplo n.º 19
0
int main (int argc, char *argv[])
{
  OilFunctionClass *klass;
  OilFunctionImpl *impl;
  OilTest *test;
  int i;
  int n;
  //int j;
  int ret;
  unsigned int cpu_flags;
  //xmlfile = "test1";
  std_log(LOG_FILENAME_LINE, "Test Started testsuite_test1");
  
  oil_init ();

  cpu_flags = oil_cpu_get_flags ();     //Returns a bitmask containing the available CPU features
  n = oil_class_get_n_classes ();       
  for (i=0;i<n; i++ ){
    klass = oil_class_get_by_index(i);

    printf("%s\n", klass->name);
    std_log(LOG_FILENAME_LINE, "class name = %s\n",klass->name);

    test = oil_test_new (klass);        //Creates a new OilTest(structure describing how to test an OilFunctionImpl for an OilFunctionClass) for the OilFunctionClass represented by klass
    if (test == NULL) {
      std_log(LOG_FILENAME_LINE, "bad prototype");
      printf("  bad prototype\n");
      continue;
    }

    for (impl = klass->first_impl; impl; impl = impl->next) 
    {
        printf("  %s\n", impl->name);
        if ((impl->flags & OIL_CPU_FLAG_MASK) & ~cpu_flags) 
        {
            std_log(LOG_FILENAME_LINE, "not supported");
            printf("not supported\n");
        } 
        else 
        {
            test->n = 1600;
            ret = oil_test_check_impl (test, impl);     //Runs the testing procedure described by test on the implementation impl
            if (ret) 
            {
                #if 0
                printf("    %lu %g\n",test->prof.min,
                (double)test->prof.total/test->prof.n);
                for(j=0;j<test->prof.hist_n;j++){
                printf("    %lu %d\n",test->prof.hist_time[j],test->prof.hist_count[j]);
                }
                #endif
                printf("    ave=%g std=%g\n", impl->profile_ave, impl->profile_std);
                //hist(test);
            } 
            else 
            {
                printf("  not tested\n");
                oil_test_free (test);
                std_log(LOG_FILENAME_LINE, "Test Failed");
                create_xml(1);
                return 1;
            }
        }
    }//for loop

    oil_test_free (test);   //Frees memory associated with test(OilTest)
  }
  std_log(LOG_FILENAME_LINE, "Test Successful");
  create_xml(0);
  return 0;
}
Ejemplo n.º 20
0
int main (int argc, char *argv[])
{
  oil_init ();

  std_log(LOG_FILENAME_LINE,"START oil_mas10_u8 TEST");
  test_oil_mas10_u8();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas10_u8_l15 TEST");
  test_oil_mas10_u8_l15();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas10_u8_sym_l15 TEST");
  test_oil_mas10_u8_sym_l15();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas12_addc_rshift_decim2_u8 TEST");
  test_oil_mas12_addc_rshift_decim2_u8();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas2_across_add_s16 TEST");
  test_oil_mas2_across_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas2_add_s16 TEST");
  test_oil_mas2_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas4_across_add_s16 TEST");
  test_oil_mas4_across_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas4_add_s16 TEST");
  test_oil_mas4_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_across_add_s16 TEST");
  test_oil_mas8_across_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_across_u8 TEST");
  test_oil_mas8_across_u8();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_add_s16 TEST");
  test_oil_mas8_add_s16();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_addc_rshift_decim2_u8 TEST");
  test_oil_mas8_addc_rshift_decim2_u8();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_u8 TEST");
  test_oil_mas8_u8();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_u8_l15 TEST");
  test_oil_mas8_u8_l15();
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  std_log(LOG_FILENAME_LINE,"START oil_mas8_u8_sym_l15 TEST");
  test_oil_mas8_u8_sym_l15(); //Getting different result than linux
  std_log(LOG_FILENAME_LINE,"END TEST\n");
  
  if(assert_failed)
      std_log(LOG_FILENAME_LINE,"Test Failed");
  else
      std_log(LOG_FILENAME_LINE,"Test Successful");

  create_xml(0);
  return 0;
}
Ejemplo n.º 21
0
int
main(int argc, char *argv[])
{
  char *s=NULL, *d=NULL;
  uint32_t *src, *dest;
  int16_t res=0;
  OilProfile prof;
  double ave, std;
  int i,j, cnt;
  double cpufreq;
  OilFunctionClass *klass;
  OilFunctionImpl *impl;
  int the_class;
  
  std_log(LOG_FILENAME_LINE,"Test Started memcpy-speed");
  
  oil_init ();
  
  s = malloc(512*1024+1024);
  d = malloc(512*1024+1024);
//  src = ((void *)((unsigned long)(s) |  0xFF ));
  //dest = ((void *)((unsigned long)(d) |  0xFF ));
    src = ((void *)((unsigned long)(s) ));
  dest = ((void *)((unsigned long)(d) ));

  for(the_class=0; the_class<3; the_class++)
  { 
      cpufreq = 1788e6;    
      switch(the_class) {
        case 0:
          klass = oil_class_get ("splat_u32_ns");
          break;
        case 1:
          klass = oil_class_get ("copy_u8");
          break;
        case 2:
          klass = oil_class_get ("sum_s16");
          break;
      }
    
      for(impl=klass->first_impl;impl;impl=impl->next) {
      std_log(LOG_FILENAME_LINE,"impl %s\n", impl->name);
    
        if (!oil_impl_is_usable(impl)) {
        std_log(LOG_FILENAME_LINE,"  not usable\n");
          continue;
        }
    
        oil_class_choose_by_name (klass, impl->name);
    
        for(i=10;i<20;i++){
          oil_profile_init (&prof);
          for(j=0;j<10;j++){
            switch(the_class) {
              case 0:
                oil_profile_start(&prof);
                oil_splat_u32_ns (dest, src, 1<<(i-2));
                oil_profile_stop(&prof);
                for(cnt=0; cnt<(1<<(i-2)); cnt++){
                    if(dest[cnt]!=*src){
                        std_log(LOG_FILENAME_LINE,"Failed at the_class=%d, cnt=%d, i=%d, j=%d, impl->name=%s\n", the_class, cnt, i, j, impl->name);
                        assert_failed =1;
                    }
                }
                
                break;
              case 1:
                oil_profile_start(&prof);
                oil_memcpy (dest, src, 1<<i);
                oil_profile_stop(&prof);
                for(cnt=0; cnt<(1<<(i-2)); cnt++){      //cnt is checked with 1<<(i-2) because dest & src are of type uint32_t*
                    if(dest[cnt]!=src[cnt]){
                        std_log(LOG_FILENAME_LINE,"Failed at the_class=%d, cnt=%d, i=%d, j=%d, impl->name=%s\n", the_class, cnt, i, j, impl->name);
                        assert_failed =1;
                    }
                }
                
                break;
              case 2:
                  {
                int16_t* src1 = (int16_t*)src;
                int16_t* dest1 = (int16_t*)dest;
                oil_profile_start(&prof);
                oil_sum_s16 (dest1, src1, 1<<(i-1));
                oil_profile_stop(&prof);
                res=0;
                for(cnt=0; cnt<(1<<(i-1)); cnt++){
                    res += src1[cnt];
                }
                if(*dest1 != res){
                    std_log(LOG_FILENAME_LINE,"Failed at the_class=%d, impl->name=%s\n", the_class, impl->name);
                    assert_failed =1;
                }
                
                  }
                break;
            }
          }
          oil_profile_get_ave_std (&prof, &ave, &std);                    
          std_log(LOG_FILENAME_LINE,"%d: %10.4g %10.4g %10.4g\n", i, ave, std,
            ave/(1<<i));
          
        }
      }
      
 }
  free(s);
  free(d);
  
  if(!assert_failed)
      std_log(LOG_FILENAME_LINE, "Test Passed");
  else
      std_log(LOG_FILENAME_LINE, "Test Failed");
  create_xml(0);
  return 0;
}
Ejemplo n.º 22
0
static void
gst_a52dec_class_init (GstA52DecClass * klass)
{
  GObjectClass *gobject_class;
  GstElementClass *gstelement_class;
  guint cpuflags;

  gobject_class = (GObjectClass *) klass;
  gstelement_class = (GstElementClass *) klass;

  gobject_class->set_property = gst_a52dec_set_property;
  gobject_class->get_property = gst_a52dec_get_property;

  gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_a52dec_change_state);

  /**
   * GstA52Dec::drc
   *
   * Set to true to apply the recommended Dolby Digital dynamic range compression
   * to the audio stream. Dynamic range compression makes loud sounds
   * softer and soft sounds louder, so you can more easily listen
   * to the stream without disturbing other people.
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC,
      g_param_spec_boolean ("drc", "Dynamic Range Compression",
          "Use Dynamic Range Compression", FALSE, G_PARAM_READWRITE));
  /**
   * GstA52Dec::mode
   *
   * Force a particular output channel configuration from the decoder. By default,
   * the channel downmix (if any) is chosen automatically based on the downstream
   * capabilities of the pipeline. 
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MODE,
      g_param_spec_enum ("mode", "Decoder Mode", "Decoding Mode (default 3f2r)",
          GST_TYPE_A52DEC_MODE, A52_3F2R, G_PARAM_READWRITE));
  /**
   * GstA52Dec::lfe
   *
   * Whether to output the LFE (Low Frequency Emitter) channel of the audio stream.
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LFE,
      g_param_spec_boolean ("lfe", "LFE", "LFE", TRUE, G_PARAM_READWRITE));

  oil_init ();

  /* If no CPU instruction based acceleration is available, end up using the
   * generic software djbfft based one when available in the used liba52 */
#ifdef MM_ACCEL_DJBFFT
  klass->a52_cpuflags = MM_ACCEL_DJBFFT;
#else
  klass->a52_cpuflags = 0;
#endif
  cpuflags = oil_cpu_get_flags ();
  if (cpuflags & OIL_IMPL_FLAG_MMX)
    klass->a52_cpuflags |= MM_ACCEL_X86_MMX;
  if (cpuflags & OIL_IMPL_FLAG_3DNOW)
    klass->a52_cpuflags |= MM_ACCEL_X86_3DNOW;
  if (cpuflags & OIL_IMPL_FLAG_MMXEXT)
    klass->a52_cpuflags |= MM_ACCEL_X86_MMXEXT;

  GST_LOG ("CPU flags: a52=%08x, liboil=%08x", klass->a52_cpuflags, cpuflags);
}