~ubuntu-branches/ubuntu/trusty/gst-plugins-base1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to gst-libs/gst/video/video-orc-dist.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-09-24 16:24:47 UTC
  • mfrom: (1.1.18) (17.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130924162447-0s1qfyjlaswtp1jg
* New upstream stable release:
  + debian/rules,
    debian/build-deps.in:
    - Build-depend on GStreamer >= 1.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
    const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n);
154
154
void video_orc_pack_NV21 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2,
155
155
    const guint8 * ORC_RESTRICT s1, int n);
 
156
void video_orc_unpack_NV24 (guint8 * ORC_RESTRICT d1,
 
157
    const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n);
 
158
void video_orc_pack_NV24 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2,
 
159
    const guint8 * ORC_RESTRICT s1, int n);
156
160
void video_orc_unpack_A420 (guint8 * ORC_RESTRICT d1,
157
161
    const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
158
162
    const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n);
5916
5920
#endif
5917
5921
 
5918
5922
 
 
5923
/* video_orc_unpack_NV24 */
 
5924
#ifdef DISABLE_ORC
 
5925
void
 
5926
video_orc_unpack_NV24 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
 
5927
    const guint8 * ORC_RESTRICT s2, int n)
 
5928
{
 
5929
  int i;
 
5930
  orc_union32 *ORC_RESTRICT ptr0;
 
5931
  const orc_int8 *ORC_RESTRICT ptr4;
 
5932
  const orc_union16 *ORC_RESTRICT ptr5;
 
5933
#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
 
5934
  volatile orc_int8 var33;
 
5935
#else
 
5936
  orc_int8 var33;
 
5937
#endif
 
5938
  orc_int8 var34;
 
5939
  orc_union16 var35;
 
5940
  orc_union32 var36;
 
5941
  orc_union16 var37;
 
5942
 
 
5943
  ptr0 = (orc_union32 *) d1;
 
5944
  ptr4 = (orc_int8 *) s1;
 
5945
  ptr5 = (orc_union16 *) s2;
 
5946
 
 
5947
  /* 0: loadpb */
 
5948
  var33 = (int) 0x000000ff;     /* 255 or 1.25987e-321f */
 
5949
 
 
5950
  for (i = 0; i < n; i++) {
 
5951
    /* 1: loadb */
 
5952
    var34 = ptr4[i];
 
5953
    /* 2: mergebw */
 
5954
    {
 
5955
      orc_union16 _dest;
 
5956
      _dest.x2[0] = var33;
 
5957
      _dest.x2[1] = var34;
 
5958
      var37.i = _dest.i;
 
5959
    }
 
5960
    /* 3: loadw */
 
5961
    var35 = ptr5[i];
 
5962
    /* 4: mergewl */
 
5963
    {
 
5964
      orc_union32 _dest;
 
5965
      _dest.x2[0] = var37.i;
 
5966
      _dest.x2[1] = var35.i;
 
5967
      var36.i = _dest.i;
 
5968
    }
 
5969
    /* 5: storel */
 
5970
    ptr0[i] = var36;
 
5971
  }
 
5972
 
 
5973
}
 
5974
 
 
5975
#else
 
5976
static void
 
5977
_backup_video_orc_unpack_NV24 (OrcExecutor * ORC_RESTRICT ex)
 
5978
{
 
5979
  int i;
 
5980
  int n = ex->n;
 
5981
  orc_union32 *ORC_RESTRICT ptr0;
 
5982
  const orc_int8 *ORC_RESTRICT ptr4;
 
5983
  const orc_union16 *ORC_RESTRICT ptr5;
 
5984
#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__)
 
5985
  volatile orc_int8 var33;
 
5986
#else
 
5987
  orc_int8 var33;
 
5988
#endif
 
5989
  orc_int8 var34;
 
5990
  orc_union16 var35;
 
5991
  orc_union32 var36;
 
5992
  orc_union16 var37;
 
5993
 
 
5994
  ptr0 = (orc_union32 *) ex->arrays[0];
 
5995
  ptr4 = (orc_int8 *) ex->arrays[4];
 
5996
  ptr5 = (orc_union16 *) ex->arrays[5];
 
5997
 
 
5998
  /* 0: loadpb */
 
5999
  var33 = (int) 0x000000ff;     /* 255 or 1.25987e-321f */
 
6000
 
 
6001
  for (i = 0; i < n; i++) {
 
6002
    /* 1: loadb */
 
6003
    var34 = ptr4[i];
 
6004
    /* 2: mergebw */
 
6005
    {
 
6006
      orc_union16 _dest;
 
6007
      _dest.x2[0] = var33;
 
6008
      _dest.x2[1] = var34;
 
6009
      var37.i = _dest.i;
 
6010
    }
 
6011
    /* 3: loadw */
 
6012
    var35 = ptr5[i];
 
6013
    /* 4: mergewl */
 
6014
    {
 
6015
      orc_union32 _dest;
 
6016
      _dest.x2[0] = var37.i;
 
6017
      _dest.x2[1] = var35.i;
 
6018
      var36.i = _dest.i;
 
6019
    }
 
6020
    /* 5: storel */
 
6021
    ptr0[i] = var36;
 
6022
  }
 
6023
 
 
6024
}
 
6025
 
 
6026
void
 
6027
video_orc_unpack_NV24 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
 
6028
    const guint8 * ORC_RESTRICT s2, int n)
 
6029
{
 
6030
  OrcExecutor _ex, *ex = &_ex;
 
6031
  static volatile int p_inited = 0;
 
6032
  static OrcCode *c = 0;
 
6033
  void (*func) (OrcExecutor *);
 
6034
 
 
6035
  if (!p_inited) {
 
6036
    orc_once_mutex_lock ();
 
6037
    if (!p_inited) {
 
6038
      OrcProgram *p;
 
6039
 
 
6040
#if 1
 
6041
      static const orc_uint8 bc[] = {
 
6042
        1, 9, 21, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 117, 110, 112,
 
6043
        97, 99, 107, 95, 78, 86, 50, 52, 11, 4, 4, 12, 1, 1, 12, 2,
 
6044
        2, 14, 1, 255, 0, 0, 0, 20, 2, 196, 32, 16, 4, 195, 0, 32,
 
6045
        5, 2, 0,
 
6046
      };
 
6047
      p = orc_program_new_from_static_bytecode (bc);
 
6048
      orc_program_set_backup_function (p, _backup_video_orc_unpack_NV24);
 
6049
#else
 
6050
      p = orc_program_new ();
 
6051
      orc_program_set_name (p, "video_orc_unpack_NV24");
 
6052
      orc_program_set_backup_function (p, _backup_video_orc_unpack_NV24);
 
6053
      orc_program_add_destination (p, 4, "d1");
 
6054
      orc_program_add_source (p, 1, "s1");
 
6055
      orc_program_add_source (p, 2, "s2");
 
6056
      orc_program_add_constant (p, 1, 0x000000ff, "c1");
 
6057
      orc_program_add_temporary (p, 2, "t1");
 
6058
 
 
6059
      orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_S1,
 
6060
          ORC_VAR_D1);
 
6061
      orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_S2,
 
6062
          ORC_VAR_D1);
 
6063
#endif
 
6064
 
 
6065
      orc_program_compile (p);
 
6066
      c = orc_program_take_code (p);
 
6067
      orc_program_free (p);
 
6068
    }
 
6069
    p_inited = TRUE;
 
6070
    orc_once_mutex_unlock ();
 
6071
  }
 
6072
  ex->arrays[ORC_VAR_A2] = c;
 
6073
  ex->program = 0;
 
6074
 
 
6075
  ex->n = n;
 
6076
  ex->arrays[ORC_VAR_D1] = d1;
 
6077
  ex->arrays[ORC_VAR_S1] = (void *) s1;
 
6078
  ex->arrays[ORC_VAR_S2] = (void *) s2;
 
6079
 
 
6080
  func = c->exec;
 
6081
  func (ex);
 
6082
}
 
6083
#endif
 
6084
 
 
6085
 
 
6086
/* video_orc_pack_NV24 */
 
6087
#ifdef DISABLE_ORC
 
6088
void
 
6089
video_orc_pack_NV24 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2,
 
6090
    const guint8 * ORC_RESTRICT s1, int n)
 
6091
{
 
6092
  int i;
 
6093
  orc_int8 *ORC_RESTRICT ptr0;
 
6094
  orc_union16 *ORC_RESTRICT ptr1;
 
6095
  const orc_union32 *ORC_RESTRICT ptr4;
 
6096
  orc_union32 var33;
 
6097
  orc_union16 var34;
 
6098
  orc_int8 var35;
 
6099
  orc_union16 var36;
 
6100
 
 
6101
  ptr0 = (orc_int8 *) d1;
 
6102
  ptr1 = (orc_union16 *) d2;
 
6103
  ptr4 = (orc_union32 *) s1;
 
6104
 
 
6105
 
 
6106
  for (i = 0; i < n; i++) {
 
6107
    /* 0: loadl */
 
6108
    var33 = ptr4[i];
 
6109
    /* 1: splitlw */
 
6110
    {
 
6111
      orc_union32 _src;
 
6112
      _src.i = var33.i;
 
6113
      var34.i = _src.x2[1];
 
6114
      var36.i = _src.x2[0];
 
6115
    }
 
6116
    /* 2: storew */
 
6117
    ptr1[i] = var34;
 
6118
    /* 3: select1wb */
 
6119
    {
 
6120
      orc_union16 _src;
 
6121
      _src.i = var36.i;
 
6122
      var35 = _src.x2[1];
 
6123
    }
 
6124
    /* 4: storeb */
 
6125
    ptr0[i] = var35;
 
6126
  }
 
6127
 
 
6128
}
 
6129
 
 
6130
#else
 
6131
static void
 
6132
_backup_video_orc_pack_NV24 (OrcExecutor * ORC_RESTRICT ex)
 
6133
{
 
6134
  int i;
 
6135
  int n = ex->n;
 
6136
  orc_int8 *ORC_RESTRICT ptr0;
 
6137
  orc_union16 *ORC_RESTRICT ptr1;
 
6138
  const orc_union32 *ORC_RESTRICT ptr4;
 
6139
  orc_union32 var33;
 
6140
  orc_union16 var34;
 
6141
  orc_int8 var35;
 
6142
  orc_union16 var36;
 
6143
 
 
6144
  ptr0 = (orc_int8 *) ex->arrays[0];
 
6145
  ptr1 = (orc_union16 *) ex->arrays[1];
 
6146
  ptr4 = (orc_union32 *) ex->arrays[4];
 
6147
 
 
6148
 
 
6149
  for (i = 0; i < n; i++) {
 
6150
    /* 0: loadl */
 
6151
    var33 = ptr4[i];
 
6152
    /* 1: splitlw */
 
6153
    {
 
6154
      orc_union32 _src;
 
6155
      _src.i = var33.i;
 
6156
      var34.i = _src.x2[1];
 
6157
      var36.i = _src.x2[0];
 
6158
    }
 
6159
    /* 2: storew */
 
6160
    ptr1[i] = var34;
 
6161
    /* 3: select1wb */
 
6162
    {
 
6163
      orc_union16 _src;
 
6164
      _src.i = var36.i;
 
6165
      var35 = _src.x2[1];
 
6166
    }
 
6167
    /* 4: storeb */
 
6168
    ptr0[i] = var35;
 
6169
  }
 
6170
 
 
6171
}
 
6172
 
 
6173
void
 
6174
video_orc_pack_NV24 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2,
 
6175
    const guint8 * ORC_RESTRICT s1, int n)
 
6176
{
 
6177
  OrcExecutor _ex, *ex = &_ex;
 
6178
  static volatile int p_inited = 0;
 
6179
  static OrcCode *c = 0;
 
6180
  void (*func) (OrcExecutor *);
 
6181
 
 
6182
  if (!p_inited) {
 
6183
    orc_once_mutex_lock ();
 
6184
    if (!p_inited) {
 
6185
      OrcProgram *p;
 
6186
 
 
6187
#if 1
 
6188
      static const orc_uint8 bc[] = {
 
6189
        1, 9, 19, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 112, 97, 99,
 
6190
        107, 95, 78, 86, 50, 52, 11, 1, 1, 11, 2, 2, 12, 4, 4, 20,
 
6191
        2, 198, 1, 32, 4, 189, 0, 32, 2, 0,
 
6192
      };
 
6193
      p = orc_program_new_from_static_bytecode (bc);
 
6194
      orc_program_set_backup_function (p, _backup_video_orc_pack_NV24);
 
6195
#else
 
6196
      p = orc_program_new ();
 
6197
      orc_program_set_name (p, "video_orc_pack_NV24");
 
6198
      orc_program_set_backup_function (p, _backup_video_orc_pack_NV24);
 
6199
      orc_program_add_destination (p, 1, "d1");
 
6200
      orc_program_add_destination (p, 2, "d2");
 
6201
      orc_program_add_source (p, 4, "s1");
 
6202
      orc_program_add_temporary (p, 2, "t1");
 
6203
 
 
6204
      orc_program_append_2 (p, "splitlw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_S1,
 
6205
          ORC_VAR_D1);
 
6206
      orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1,
 
6207
          ORC_VAR_D1, ORC_VAR_D1);
 
6208
#endif
 
6209
 
 
6210
      orc_program_compile (p);
 
6211
      c = orc_program_take_code (p);
 
6212
      orc_program_free (p);
 
6213
    }
 
6214
    p_inited = TRUE;
 
6215
    orc_once_mutex_unlock ();
 
6216
  }
 
6217
  ex->arrays[ORC_VAR_A2] = c;
 
6218
  ex->program = 0;
 
6219
 
 
6220
  ex->n = n;
 
6221
  ex->arrays[ORC_VAR_D1] = d1;
 
6222
  ex->arrays[ORC_VAR_D2] = d2;
 
6223
  ex->arrays[ORC_VAR_S1] = (void *) s1;
 
6224
 
 
6225
  func = c->exec;
 
6226
  func (ex);
 
6227
}
 
6228
#endif
 
6229
 
 
6230
 
5919
6231
/* video_orc_unpack_A420 */
5920
6232
#ifdef DISABLE_ORC
5921
6233
void
6497
6809
      static const orc_uint8 bc[] = {
6498
6810
        1, 9, 31, 118, 105, 100, 101, 111, 95, 111, 114, 99, 95, 114, 101, 115,
6499
6811
        97, 109, 112, 108, 101, 95, 98, 105, 108, 105, 110, 101, 97, 114, 95,
6500
 
        117,
 
6812
            117,
6501
6813
        51, 50, 11, 4, 4, 12, 4, 4, 16, 4, 16, 4, 51, 0, 4, 24,
6502
6814
        25, 2, 0,
6503
6815
      };