• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LOOP函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LOOP函数的典型用法代码示例。如果您正苦于以下问题:C++ LOOP函数的具体用法?C++ LOOP怎么用?C++ LOOP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LOOP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: calcThreshExp

/* loudness calculation (threshold to the power of redExp) */
static void calcThreshExp(float thrExp[MAX_CHANNELS][MAX_GROUPED_SFB],
                          PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],
                          const int nChannels)
{
   int ch, sfb,sfbGrp;

   COUNT_sub_start("calcThreshExp");

   LOOP(1);
   for (ch=0; ch<nChannels; ch++) {
    PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];

    PTR_INIT(1); /* counting operation above */

    INDIRECT(2); LOOP(1);
    for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup) {

      PTR_INIT(2); /* pointer for thrExp[][],
                                  psyOutChan->sfbThreshold[]
                   */
      INDIRECT(1); LOOP(1);
      for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {

        TRANS(1); STORE(1);
        thrExp[ch][sfbGrp+sfb] = (float) pow(psyOutChan->sfbThreshold[sfbGrp+sfb], redExp);
      }
    }
   }

   COUNT_sub_end();
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:32,代码来源:adj_thr.c


示例2: CShortBlock_Init

void CShortBlock_Init(CAacDecoderChannelInfo *pAacDecoderChannelInfo)
{
  int group,band;
  char *pCodeBook = pAacDecoderChannelInfo->pCodeBook;
  short *pScaleFactor = pAacDecoderChannelInfo->pScaleFactor;

  COUNT_sub_start("CShortBlock_Init");

  INDIRECT(2); PTR_INIT(2); /* counting previous operations */

  PTR_INIT(2); /* pCodeBook[]
                  pScaleFactor[]
               */
  LOOP(1);
  for (group=0; group<MaximumGroups; group++)
  {
    LOOP(1);
    for (band=0; band<MaximumScaleFactorBandsShort; band++)
    {
      MOVE(2);
      pCodeBook[group*MaximumScaleFactorBandsShort+band] = 0;
      pScaleFactor[group*MaximumScaleFactorBandsShort+band] = 0;
    }
  }

  COUNT_sub_end();
}
开发者ID:fffonion,项目名称:V8,代码行数:27,代码来源:shortblock.cpp


示例3: reduceThresholds

/* apply reduction formula */
static void reduceThresholds(PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],
                             int ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB],
                             float thrExp[MAX_CHANNELS][MAX_GROUPED_SFB],
                             const int nChannels,
                             const float redVal)
{
   int ch, sfb,sfbGrp;
   float sfbEn, sfbThr,sfbThrReduced;

   COUNT_sub_start("reduceThresholds");

   LOOP(1);
   for(ch=0; ch<nChannels; ch++) {
      PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];

      PTR_INIT(1); /* counting previous operation */

      INDIRECT(2); LOOP(1);
      for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){

        PTR_INIT(5); /* pointers for psyOutChan->sfbMinSnr[sfbGrp+sfb],
                                     psyOutChan->sfbEnergy[sfbGrp+sfb],
                                     psyOutChan->sfbThreshold[sfbGrp+sfb],
                                     thrExp[ch][sfbGrp+sfb],
                                     ahFlag[ch][sfbGrp+sfb]
                     */
        INDIRECT(1); LOOP(1);
        for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {

         MOVE(2);
         sfbEn  = psyOutChan->sfbEnergy[sfbGrp+sfb];
         sfbThr = psyOutChan->sfbThreshold[sfbGrp+sfb];

         ADD(1); BRANCH(1);
         if (sfbEn > sfbThr) {
            /* threshold reduction formula */

            ADD(1); TRANS(1);
            sfbThrReduced = (float) pow(thrExp[ch][sfbGrp+sfb]+redVal, invRedExp);

            /* avoid holes */
            MULT(1); ADD(2); LOGIC(1); BRANCH(1);
            if ((sfbThrReduced > psyOutChan->sfbMinSnr[sfbGrp+sfb] * sfbEn) && (ahFlag[ch][sfbGrp+sfb] != NO_AH)){

              ADD(1); BRANCH(1); MOVE(1);
              sfbThrReduced = max(psyOutChan->sfbMinSnr[sfbGrp+sfb] * sfbEn, sfbThr);

              MOVE(1);
              ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;
            }

            MOVE(1);
            psyOutChan->sfbThreshold[sfbGrp+sfb] = sfbThrReduced;
         }
        }
      }
   }

   COUNT_sub_end();
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:61,代码来源:adj_thr.c


示例4: twoChannelFiltering

static void twoChannelFiltering( const float *pQmf,
                                 float *mHybrid )
{
  int n;
  float cum0, cum1;

  FLC_sub_start("twoChannelFiltering");

  LOOP(1); PTR_INIT(2);
  MULT(1);
  cum0 = 0.5f * pQmf[HYBRID_FILTER_DELAY];

  MOVE(1);
  cum1 = 0;

  LOOP(1); PTR_INIT(2);
  for(n = 0; n < 6; n++) {

    MAC(1); MULT(1);
    cum1 += p2_6[n] * pQmf[2*n+1];
  }

  ADD(1); STORE(1);
  mHybrid[0] = cum0 + cum1;
  ADD(1); STORE(1);
  mHybrid[1] = cum0 - cum1;

  FLC_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:29,代码来源:hybrid_dec.c


示例5: LOOP

void
VideoConsumer::HandleEvent(const media_timed_event* event, bigtime_t lateness,
	bool realTimeEvent)
{
	LOOP("VideoConsumer::HandleEvent\n");
	
	switch (event->type) {
		case BTimedEventQueue::B_START:
			PROGRESS("VideoConsumer::HandleEvent - START\n");
			_SetPerformanceTimeBase(event->event_time);
			break;
		case BTimedEventQueue::B_WARP:
		case BTimedEventQueue::B_SEEK:
			PROGRESS("VideoConsumer::HandleEvent - WARP or SEEK\n");
			_SetPerformanceTimeBase(event->bigdata);
			break;

		case BTimedEventQueue::B_STOP:
			PROGRESS("VideoConsumer::HandleEvent - STOP\n");
			EventQueue()->FlushEvents(event->event_time, BTimedEventQueue::B_ALWAYS, true, BTimedEventQueue::B_HANDLE_BUFFER);
			// unset the target's bitmap
			_UnsetTargetBuffer();
			break;

		case BTimedEventQueue::B_HANDLE_BUFFER:
			LOOP("VideoConsumer::HandleEvent - HANDLE BUFFER\n");
			_HandleBuffer(static_cast<BBuffer*>(event->pointer));
			break;
		default:
			ERROR("VideoConsumer::HandleEvent - BAD EVENT\n");
			break;
	}			
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:33,代码来源:VideoConsumer.cpp


示例6: current

/*
  The function creates the interpolated spectral data according to the 
  energy of the last good frame and the current (good) frame.
*/
void CConcealment_InterpolateBuffer (float       *spectrum,
                                     float       *enPrev,
                                     float       *enAct,
                                     int          sfbCnt,
                                     const short *pSfbOffset)
{
  int    sfb, line = 0;
  float  multiplier;

  FLC_sub_start("CConcealment_InterpolateBuffer");

  MOVE(1); /* counting previous operation */

  PTR_INIT(3); /* enAct[]
                  enPrev[]
                  spectrum[]
               */
  LOOP(1);
  for(sfb = 0; sfb < sfbCnt; sfb++) {

    DIV(1); TRANS(1);
    multiplier = (float) pow(enAct[sfb] / enPrev[sfb], 0.25f);

    LOOP(1);
    for(; line < pSfbOffset[sfb+1]; line++) {

      MULT(1); STORE(1);
      spectrum [line] = spectrum[line] * multiplier;
    }
  }

  FLC_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:37,代码来源:conceal.c


示例7: nonlocal_vec

static double nonlocal_vec(real *u, uint n, int op,
                           const nonlocal_info *info, MPI_Comm comm)
{
  uint np = info->np, i;
  MPI_Request *reqs = info->reqs;
  uint *targ = info->target;
  uint *nshared = info->nshared;
  uint *sh_ind = info->sh_ind;
  uint id = info->id;
  real *buf = info->buf;
  uint size = n*sizeof(real);
#ifdef GS_TIMING
  double time0, time1;
#endif
  for(i=0;i<np;++i) {
    int nsn=n*nshared[i];
    MPI_Irecv(buf,nsn,REAL_MPI,targ[i],targ[i],comm,reqs++);
    buf+=nsn;
  }
#ifdef GS_BARRIER
  MPI_Barrier(comm);
#endif
#ifdef GS_TIMING
  time0 = MPI_Wtime();
#endif
  for(i=0;i<np;++i) {
    uint ns=nshared[i], c=ns;
    real *start = buf;
    for(;c;--c) memcpy(buf,u+n*(*sh_ind++),size), buf+=n;
    MPI_Isend(start,ns*n,REAL_MPI,targ[i],id,comm,reqs++);
  }
  MPI_Waitall(np*2,info->reqs,MPI_STATUSES_IGNORE);
#ifdef GS_TIMING
  time1 = MPI_Wtime();
#endif
  buf = info->buf;
  sh_ind = info->sh_ind;
# define LOOP(OP) do { \
    for(i=0;i<np;++i) { \
      uint c,j; \
      for(c=nshared[i];c;--c) { \
        real *uu=u+n*(*sh_ind++); \
        for(j=n;j;--j) { OP(*uu,*buf); ++uu, ++buf; } \
      } \
    } \
  } while(0)
  switch(op) {
    case OP_ADD: LOOP(DO_ADD); break;
    case OP_MUL: LOOP(DO_MUL); break;
    case OP_MIN: LOOP(DO_MIN); break;
    case OP_MAX: LOOP(DO_MAX); break;
    case OP_BPR: LOOP(DO_BPR); break;
  }
# undef LOOP
#ifdef GS_TIMING
  return time1-time0;
#else
  return 0;
#endif
}
开发者ID:YHUCD,项目名称:NEKCEM,代码行数:60,代码来源:gs0.c


示例8: Var_Dump

void
Var_Dump(void)
{
	Var **t;

	unsigned int i;
	const char *banner;
	bool first = true;

	t = sort_ohash_by_name(&global_variables);
/* somewhat dirty, but does the trick */

#define LOOP(mask, value, do_stuff) \
	for (i = 0; t[i] != NULL; i++) \
		if ((t[i]->flags & (mask)) == (value)) { \
			if (banner) { \
				if (first) \
					first = false; \
				else \
					putchar('\n'); \
				fputs(banner, stdout); \
				banner = NULL; \
			} \
		    do_stuff; \
		}

	banner = "#variables from command line:\n";
	LOOP(VAR_FROM_CMD | VAR_DUMMY, VAR_FROM_CMD, print_var(t[i]));

	banner = "#global variables:\n";
	LOOP(VAR_FROM_ENV| VAR_FROM_CMD | VAR_DUMMY, 0, print_var(t[i]));

	banner = "#variables from env:\n";
	LOOP(VAR_FROM_ENV|VAR_DUMMY, VAR_FROM_ENV, print_var(t[i]));

	banner = "#variable name seen, but not defined:";
	LOOP(VAR_DUMMY|POISONS, VAR_DUMMY, printf(" %s", t[i]->name));

#undef LOOP

	printf("\n\n");

	for (i = 0; t[i] != NULL; i++)
		switch(t[i]->flags & POISONS) {
		case POISON_NORMAL:
			printf(".poison %s\n", t[i]->name);
			break;
		case POISON_EMPTY:
			printf(".poison empty(%s)\n", t[i]->name);
			break;
		case POISON_NOT_DEFINED:
			printf(".poison !defined(%s)\n", t[i]->name);
			break;
		default:
			break;
		}
	free(t);
	printf("\n");
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:59,代码来源:var.c


示例9: prepareSfbPe

/* constants that do not change during successive pe calculations */
void prepareSfbPe(PE_CHANNEL_DATA *peChanData,
                  const float *sfbEnergy,
                  const float *sfbThreshold,
                  const float *sfbFormFactor,
                  const int     *sfbOffset,
                  const int     sfbCnt,
                  const int     sfbPerGroup,
                  const int     maxSfbPerGroup)
{
   int sfbGrp,sfb;
   int sfbWidth;
   float avgFormFactor;

   COUNT_sub_start("prepareSfbPe");

   LOOP(1);
   for(sfbGrp = 0;sfbGrp < sfbCnt;sfbGrp+=sfbPerGroup){

    PTR_INIT(6); /* pointers for sfbEnergy[],
                                 sfbThreshold[],
                                 sfbOffset[],
                                 sfbFormFactor[],
                                 peChanData->sfbNLines[],
                                 peChanData->sfbLdEnergy[]
                 */
    LOOP(1);
    for (sfb=0; sfb<maxSfbPerGroup; sfb++) {

      ADD(1); BRANCH(1);
      if (sfbEnergy[sfbGrp+sfb] > sfbThreshold[sfbGrp+sfb]) {

         ADD(1);
         sfbWidth = sfbOffset[sfbGrp+sfb+1] - sfbOffset[sfbGrp+sfb];

         /* estimate number of active lines */
         DIV(1); TRANS(1);
         avgFormFactor = (float) pow(sfbEnergy[sfbGrp+sfb]/(float)sfbWidth, 0.25f);

         DIV(1); STORE(1);
         peChanData->sfbNLines[sfbGrp+sfb] =

         sfbFormFactor[sfbGrp+sfb]/avgFormFactor;

          /* ld(sfbEn) */
         TRANS(1); MULT(1); STORE(1);
         peChanData->sfbLdEnergy[sfbGrp+sfb] = (float) (log(sfbEnergy[sfbGrp+sfb]) * LOG2_1);
      }
      else {

         MOVE(2);
         peChanData->sfbNLines[sfbGrp+sfb] = 0.0f;
         peChanData->sfbLdEnergy[sfbGrp+sfb] = 0.0f;
      }
    }
   }

   COUNT_sub_end();
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:59,代码来源:line_pe.c


示例10: CalcBandEnergyMS

void CalcBandEnergyMS(const float *mdctSpectrumLeft,
                      const float *mdctSpectrumRight,
                      const int   *bandOffset,
                      const int    numBands,
                      float      *bandEnergyMid,
                      float       *bandEnergyMidSum,
                      float      *bandEnergySide,
                      float       *bandEnergySideSum) {

    int i, j;

    COUNT_sub_start("CalcBandEnergyMS");

    MOVE(3);
    j = 0;
    *bandEnergyMidSum = 0.0f;
    *bandEnergySideSum = 0.0f;

    PTR_INIT(5); /* pointers for bandEnergyMid[],
                               bandEnergySide[],
                               bandOffset[],
                               mdctSpectrumLeft[],
                               mdctSpectrumRight[]
               */
    LOOP(1);
    for(i=0; i<numBands; i++) {

        MOVE(2);
        bandEnergyMid[i] = 0.0f;
        bandEnergySide[i] = 0.0f;

        LOOP(1);
        while (j < bandOffset[i+1]) {
            float specm, specs;

            ADD(2);
            MULT(2);
            specm = 0.5f * (mdctSpectrumLeft[j] + mdctSpectrumRight[j]);
            specs = 0.5f * (mdctSpectrumLeft[j] - mdctSpectrumRight[j]);

            MAC(2);
            STORE(2);
            bandEnergyMid[i]  += specm * specm;
            bandEnergySide[i] += specs * specs;

            j++;
        }
        ADD(2);
        STORE(2);
        *bandEnergyMidSum += bandEnergyMid[i];
        *bandEnergySideSum += bandEnergySide[i];

    }

    COUNT_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:56,代码来源:band_nrg.c


示例11: local_condense_vec

static void local_condense_vec(real *u, uint n, int op, const sint *cm)
{
  switch(op) {
    case OP_ADD: LOOP(DO_ADD); break;
    case OP_MUL: LOOP(DO_MUL); break;
    case OP_MIN: LOOP(DO_MIN); break;
    case OP_MAX: LOOP(DO_MAX); break;
    case OP_BPR: LOOP(DO_BPR); break;
  }
}
开发者ID:YHUCD,项目名称:NEKCEM,代码行数:10,代码来源:gs0.c


示例12: findClosestEntry

static int
findClosestEntry(int goalSb,
                 unsigned char *v_k_master,
                 int numMaster,
                 int direction)
{
  int index;

  COUNT_sub_start("findClosestEntry");

  ADD(1); BRANCH(1);
  if( goalSb <= v_k_master[0] )
  {
    COUNT_sub_end();
    return v_k_master[0];
  }

  INDIRECT(1); ADD(1); BRANCH(1);
  if( goalSb >= v_k_master[numMaster] )
  {
    COUNT_sub_end();
    return v_k_master[numMaster];
  }

  BRANCH(1);
  if(direction) {

    MOVE(1);
    index = 0;

    PTR_INIT(1); /* v_k_master[index] */
    LOOP(1);
    while( v_k_master[index] < goalSb ) {

      ADD(1);
      index++;
    }
  } else {

    MOVE(1);
    index = numMaster;

    PTR_INIT(1); /* v_k_master[index] */
    LOOP(1);
    while( v_k_master[index] > goalSb ) {

      ADD(1);
      index--;
    }
  }

  COUNT_sub_end();

  return v_k_master[index];
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:55,代码来源:ton_corr.c


示例13: main

int main(int argc, char **argv)
{
    int n, i;
    char *s;
    char tmp[256];
    void *p=(void*)0xdeadbeef;

    if (argc < 3) {
        usage();
        return 1;
    }
    s = argv[2];

    /* pre-printf tests */
    TEST("pre-printf");
    RUN(printf("string\n"));
    RUN(printf("%s\n", s));
    RUN(printf("%d\n", 45));
    RUN(printf("%d\n", 45098));
    RUN(printf("%d\n", (int32_t)INT_MAX));
    RUN(printf("%u\n", (uint32_t)INT_MAX+1));
    RUN(printf("%u\n", (uint32_t)UINT_MAX));

    /* Test strtol */
    TEST("strtol");
    RUN(printf("%ld\n", strtol("678", NULL, 0)));
    RUN(printf("%ld\n", strtol("0x4567", NULL, 0)));
    RUN(printf("%ld\n", strtol("0777", NULL, 0)));
    RUN(printf("%ld\n", strtol(argv[1], NULL, 0)));

    n = strtol(argv[1], NULL, 0);

    /* Dynamic printf */
    TEST("printf");

    LOOP(n)
        RUN(printf("%d\n", i*i*2));
    ENDLOOP;
    LOOP(n)
        RUN(printf("%.2f\n", 1000.0/i/i));
    ENDLOOP
    LOOP(n)
        RUN(printf("%x\n", i+i*45));
    ENDLOOP
    RUN(printf("%s%s\n", s, s));
    RUN(printf("%s%d%x%.2f%x%u%lu\n", s, n, n*n, 1024.0/n/n/n, 879875, (unsigned)n*n, (unsigned long)n*765*n));
    RUN(printf("%p\n", p));

    /* snprintf tests */
    TEST("snprintf");

    RUN(
        snprintf(tmp, 256, "Testing snprintf %d", n);
        printf("%s\n", tmp);
       );
开发者ID:gabr1e11,项目名称:dreamcast,代码行数:55,代码来源:sh4tests.c


示例14: nonlocal

static double nonlocal(real *u, int op, const nonlocal_info *info,
                       MPI_Comm comm)
{
  uint np = info->np, i;
  MPI_Request *reqs = info->reqs;
  uint *targ = info->target;
  uint *nshared = info->nshared;
  uint *sh_ind = info->sh_ind;
  uint id = info->id;
  real *buf = info->buf;
#ifdef GS_TIMING
  double time0, time1;
#endif
  for(i=0;i<np;++i) {
    MPI_Irecv(buf,nshared[i],REAL_MPI,targ[i],targ[i],comm,reqs++);
    buf+=nshared[i];
  }
#ifdef GS_BARRIER
  MPI_Barrier(comm);
#endif
#ifdef GS_TIMING
  time0 = MPI_Wtime();
#endif
  for(i=0;i<np;++i) {
    uint c = nshared[i];
    real *start = buf;
    for(;c;--c) *buf++ = u[*sh_ind++];
    MPI_Isend(start,nshared[i],REAL_MPI,targ[i],id,comm,reqs++);
  }
  MPI_Waitall(np*2,info->reqs,MPI_STATUSES_IGNORE);
#ifdef GS_TIMING
  time1 = MPI_Wtime();
#endif
  buf = info->buf;
  sh_ind = info->sh_ind;
# define LOOP(OP) do { \
    for(i=0;i<np;++i) { \
      uint c; \
      for(c=nshared[i];c;--c) { OP(u[*sh_ind],*buf); ++sh_ind, ++buf; } \
    } \
  } while(0)
  switch(op) {
    case OP_ADD: LOOP(DO_ADD); break;
    case OP_MUL: LOOP(DO_MUL); break;
    case OP_MIN: LOOP(DO_MIN); break;
    case OP_MAX: LOOP(DO_MAX); break;
    case OP_BPR: LOOP(DO_BPR); break;
  }
# undef LOOP
#ifdef GS_TIMING
  return time1-time0;
#else
  return 0;
#endif
}
开发者ID:YHUCD,项目名称:NEKCEM,代码行数:55,代码来源:gs0.c


示例15: inverseModulation

/*
 *
 * \brief Perform complex-valued inverse modulation of the subband
 *        samples stored in rSubband (real part) and iSubband (imaginary
 *        part) and stores the result in timeOut
 *
 */
static void
inverseModulation (float *qmfReal,
                   float *qmfImag,
                   HANDLE_SBR_QMF_FILTER_BANK synQmf
                   )
{
  int i, no_synthesis_channels, M;

  float r1, i1, r2, i2;

  COUNT_sub_start("inverseModulation");

  INDIRECT(1); MOVE(1);
  no_synthesis_channels = synQmf->no_channels;

  MULT(1);
  M = no_synthesis_channels / 2;
  PTR_INIT(2);  /* pointer for qmfReal[],
                               qmfImag[] */
  INDIRECT(1); LOOP(1);
  for (i = synQmf->usb; i < no_synthesis_channels; i++) {
    MOVE(2);

    qmfReal[i]=qmfImag[i]=0;
  }

  FUNC(2);
  cosMod (qmfReal, synQmf);
  FUNC(2);
  sinMod (qmfImag, synQmf);

  PTR_INIT(4);  /* pointer for qmfReal[],
                               qmfImag[],
                               qmfImag[no_synthesis_channels - 1 - i],
                               qmfReal[no_synthesis_channels - i - 1]   */
  LOOP(1);
  for (i = 0; i < M; i++) {

    MOVE(4);
    r1 = qmfReal[i];
    i2 = qmfImag[no_synthesis_channels - 1 - i];
    r2 = qmfReal[no_synthesis_channels - i - 1];
    i1 = qmfImag[i];

    ADD(4); STORE(4);
    qmfReal[i] = (r1 - i1);
    qmfImag[no_synthesis_channels - 1 - i] = -(r1 + i1);
    qmfReal[no_synthesis_channels - i - 1] = (r2 - i2);
    qmfImag[i] = -(r2 + i2);
  }

  COUNT_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:60,代码来源:qmf_dec.c


示例16: trace_back_lpo_po_alignment

void trace_back_lpo_po_alignment(int len_x,LPOLetter_T seq_x[],
				 int len_y,LPOLetter_T seq_y[],
				 LPOMove_T **move,
				 LPOLetterRef_T best_x,
				 LPOLetterRef_T best_y,
				 LPOLetterRef_T **x_to_y,
				 LPOLetterRef_T **y_to_x)
{
  int i;
  LPOLetterRef_T new_x,*x_al=NULL,*y_al=NULL;
  LPOLetterLink_T *left;

  
  CALLOC(x_al,len_x,LPOLetterRef_T);
  CALLOC(y_al,len_y,LPOLetterRef_T);
  LOOP (i,len_x) x_al[i]= INVALID_LETTER_POSITION;
  LOOP (i,len_y) y_al[i]= INVALID_LETTER_POSITION;

  while (best_x>=0 && best_y>=0) {
    if (move[best_x][best_y].is_aligned) {/* ALIGNED! MAP best_x <--> best_y */
      x_al[best_x]=best_y;
      y_al[best_y]=best_x;
    }

    if (0==move[best_x][best_y].x /* HIT START OF THE ALIGNMENT, SO QUIT */
	&& 0==move[best_x][best_y].y)
      break;

    if ((i=move[best_x][best_y].x)>0) { /* TRACE BACK ON X */
      for (left= &seq_x[best_x].left;--i >0;left=left->more); /* USE iTH MOVE*/
      new_x = left->ipos;
    }
    else new_x=best_x;
    if ((i=move[best_x][best_y].y)>0) { /* TRACE BACK ON Y */
      for (left= &seq_y[best_y].left;--i >0;left=left->more); /* USE iTH MOVE*/
      best_y = left->ipos;
    }
    best_x=new_x;
  }


  if (x_to_y) /* HAND BACK ALIGNMENT RECIPROCAL MAPPINGS */
    *x_to_y = x_al;
  else
    free(x_al);
  if (y_to_x)
    *y_to_x = y_al;
  else
    free(y_al);
  return;
}
开发者ID:Nicholas-NVS,项目名称:bio-pipeline,代码行数:51,代码来源:align_lpo_po.c


示例17: gmStage1

static void
gmStage1(SECTION_INFO * section,
         int bitLookUp[MAX_SFB_LONG][CODE_BOOK_ESC_NDX + 1],
         const int maxSfb,
         const int *sideInfoTab)
{
  int mergeStart = 0, mergeEnd;

  COUNT_sub_start("gmStage1");

  MOVE(1); /* counting previous operations */

  LOOP(1);
  do
  {

    PTR_INIT(4); /* pointers for section[mergeStart]
                                 section[mergeEnd]
                                 bitLookUp[mergeStart]
                                 bitLookUp[mergeEnd]
                 */
    ADD(1); LOOP(1);
    for (mergeEnd = mergeStart + 1; mergeEnd < maxSfb; mergeEnd++)
    {
      ADD(1); BRANCH(1);
      if (section[mergeStart].codeBook != section[mergeEnd].codeBook)
        break;

      ADD(1); STORE(1);
      section[mergeStart].sfbCnt++;

      ADD(1); STORE(1);
      section[mergeStart].sectionBits += section[mergeEnd].sectionBits;

      FUNC(2);
      mergeBitLookUp(bitLookUp[mergeStart], bitLookUp[mergeEnd]);
    }

    INDIRECT(1); ADD(1); STORE(1);
    section[mergeStart].sectionBits += sideInfoTab[section[mergeStart].sfbCnt];

    MOVE(1);
    section[mergeEnd - 1].sfbStart = section[mergeStart].sfbStart;

    MOVE(1);
    mergeStart = mergeEnd;

  } while (mergeStart < maxSfb);

  COUNT_sub_end();
}
开发者ID:cpopescu,项目名称:whispermedialib,代码行数:51,代码来源:dyn_bits.c


示例18: calcPeNoAH

/* sum the pe data only for bands where avoid hole is inactive */
static void calcPeNoAH(float *pe,
                       float *constPart,
                       float  *nActiveLines,
                       PE_DATA *peData,
                       int ahFlag[MAX_CHANNELS][MAX_GROUPED_SFB],
                       PSY_OUT_CHANNEL  psyOutChannel[MAX_CHANNELS],
                       const int nChannels)
{
   int ch, sfb,sfbGrp;

   COUNT_sub_start("calcPeNoAH");

   MOVE(3);
   *pe = 0.0f;
   *constPart = 0.0f;
   *nActiveLines = 0;

   LOOP(1);
   for(ch=0; ch<nChannels; ch++) {
      PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch];
      PE_CHANNEL_DATA *peChanData = &peData->peChannelData[ch];

      PTR_INIT(2); /* counting previous operations */

      INDIRECT(2); LOOP(1);
      for(sfbGrp = 0;sfbGrp < psyOutChan->sfbCnt;sfbGrp+= psyOutChan->sfbPerGroup){

        PTR_INIT(4); /* pointers for ahFlag[ch][sfbGrp+sfb],
                                     peChanData->sfbPe[sfbGrp+sfb],
                                     peChanData->sfbConstPart[sfbGrp+sfb],
                                     peChanData->sfbNActiveLines[sfbGrp+sfb]
                     */
        INDIRECT(1); LOOP(1);
        for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {

          ADD(1); BRANCH(1);
          if(ahFlag[ch][sfbGrp+sfb] < AH_ACTIVE) {

            ADD(3); STORE(3);
            *pe += peChanData->sfbPe[sfbGrp+sfb];
            *constPart += peChanData->sfbConstPart[sfbGrp+sfb];
            *nActiveLines += peChanData->sfbNActiveLines[sfbGrp+sfb];
          }
        }
      }
   }

   COUNT_sub_end();
}
开发者ID:KISSMonX,项目名称:aacplusenc,代码行数:50,代码来源:adj_thr.c


示例19: createCplxAnalysisQmfBank

/*
 *
 * \brief Create QMF filter bank instance
 *
 * \return 0 if succesful
 *
 */
int
createCplxAnalysisQmfBank (HANDLE_SBR_QMF_FILTER_BANK h_sbrQmf,
                           int noCols,
                           int lsb,
                           int usb,
                           int chan)
{
  int L;

  COUNT_sub_start("createCplxAnalysisQmfBank");


  FUNC(2); LOOP(1); PTR_INIT(1); MOVE(1); STORE(sizeof(SBR_QMF_FILTER_BANK));
  memset(h_sbrQmf,0,sizeof(SBR_QMF_FILTER_BANK));


  MOVE(1);
  L = NO_ANALYSIS_CHANNELS;

  PTR_INIT(2);
  h_sbrQmf->p_filter = sbr_qmf_64_640;
  h_sbrQmf->pDct4Twiddle = dct4TwiddleTable;

#ifndef LP_SBR_ONLY
  PTR_INIT(5);
  h_sbrQmf->cos_twiddle = sbr_cos_twiddle_L32;
  h_sbrQmf->sin_twiddle = sbr_sin_twiddle_L32;
  h_sbrQmf->alt_sin_twiddle = sbr_alt_sin_twiddle_L32;
  h_sbrQmf->t_cos = sbr_t_cos_L32;
  h_sbrQmf->t_sin = sbr_t_sin_L32;
#endif

  MOVE(4);
  h_sbrQmf->no_channels = L;
  h_sbrQmf->no_col = noCols;
  h_sbrQmf->lsb = lsb;
  h_sbrQmf->usb = usb;

  PTR_INIT(1);
  h_sbrQmf->FilterStatesAna   = &(sbr_CodecQmfStatesAnalysis[chan*QMF_FILTER_STATE_ANA_SIZE]);

  FUNC(2); LOOP(1); PTR_INIT(1); MOVE(1); STORE(QMF_FILTER_STATE_ANA_SIZE);
  memset(h_sbrQmf->FilterStatesAna,0,QMF_FILTER_STATE_ANA_SIZE*sizeof(float));

  COUNT_sub_end();

  return (0);

}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:56,代码来源:qmf_dec.c


示例20: sbrForwardModulation

/*
 *
 * \brief Perform complex-valued forward modulation of the time domain
 *        data of timeIn and stores the real part of the subband
 *        samples in rSubband, and the imaginary part in iSubband
 *
 */
static void
sbrForwardModulation (const float *timeIn,
                      float *rSubband,
                      float *iSubband,
                      HANDLE_SBR_QMF_FILTER_BANK anaQmf
                      )
{
  int i, offset;

  float real, imag;

  COUNT_sub_start("sbrForwardModulation");

  MOVE(1);
  offset = 2 * NO_ANALYSIS_CHANNELS;

  PTR_INIT(1);  /* pointer for timeIn[offset - 1 - i] */
  LOOP(1);
  for (i = 0; i < NO_ANALYSIS_CHANNELS; i++) {
    ADD(2); STORE(2);
    rSubband[i] = timeIn[i] - timeIn[offset - 1 - i];
    iSubband[i] = timeIn[i] + timeIn[offset - 1 - i];
  }

  FUNC(2);
  cosMod (rSubband, anaQmf);
  FUNC(2);
  sinMod (iSubband, anaQmf);

  PTR_INIT(4);  /* pointers for rSubband[i],
                                iSubband[i],
                                anaQmf->t_cos[i],
                                anaQmf->t_sin[i]  */
  INDIRECT(1); LOOP(1);
  for (i = 0; i < anaQmf->lsb; i++) {

    MOVE(2);
    real = rSubband[i];
    imag = iSubband[i];

    MULT(1); MAC(1); STORE(1);
    rSubband[i] = real * anaQmf->t_cos[i] + imag * anaQmf->t_sin[i];
    MULT(2); ADD(1); STORE(1);
    iSubband[i] = imag * anaQmf->t_cos[i] - real * anaQmf->t_sin[i];
  }

  COUNT_sub_end();
}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:55,代码来源:qmf_dec.c



注:本文中的LOOP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LOOP_FOREVER函数代码示例发布时间:2022-05-30
下一篇:
C++ LOOKUP函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap