Exemple #1
0
void convert_polh_vector(Data_Obj *flt_dp,Data_Obj *polh_dp)
{
	uint32_t i,j;
	short *rpdp;
	float *cvt_p;
	Fmt_Pt fp1;
	int station;

	if( OBJ_PREC(flt_dp) != PREC_SP ){
		sprintf(ERROR_STRING,"convert_polh_data:  object %s has precision %s, should be %s",
				OBJ_NAME(flt_dp),PREC_NAME(OBJ_PREC_PTR(flt_dp)),PREC_NAME(prec_for_code(PREC_SP)));
		warn(ERROR_STRING);
		return;
	}
	if( OBJ_COLS(flt_dp) != OBJ_COLS(polh_dp) ){
		sprintf(ERROR_STRING,"convert_polh_data:  vectors %s (%d) and %s (%d) do not have the same number of columns",
				OBJ_NAME(flt_dp),OBJ_COLS(flt_dp),OBJ_NAME(polh_dp),OBJ_COLS(polh_dp));
		warn(ERROR_STRING);
		return;
	}
	/* BUG should make sure that tdim of flt_dp is correct! */

	/* assume that the object has already been checked for proper dim, type... */

	if( n_active_stations == 2 )
		station=0;
	else if(n_active_stations < 1 ){
		warn("format_polh_vector:  no active stations!?");
		return;
	} else
		station=curr_station_idx;

	rpdp = (short *) OBJ_DATA_PTR(polh_dp);

	for(i=0;i<OBJ_COLS(polh_dp);i++){
		Polh_Record_Format *prfp;

		cvt_p = ((float *) OBJ_DATA_PTR(flt_dp)) + i * OBJ_PXL_INC(flt_dp);

		prfp = &station_info[station].sd_multi_prf;
		format_polh_data(&fp1,rpdp,prfp);
		for(j=0;j<prfp->rf_n_data;j++){
			Polh_Output_Type type;
			type = prfp->rf_output[j];
			convert_chunk(cvt_p,&fp1,type);
			cvt_p += od_tbl[type].od_strings;	/* BUG not the right variable?... */
		}
		rpdp += prfp->rf_n_words;
		if( n_active_stations == 2 )
			station ^= 1;
	}
}
Exemple #2
0
void yuv422_to_rgba8(const unsigned char *src_pixels, unsigned char *dest_pixels, int width, int height,
					 size_t src_stride, size_t dest_stride) {
  int C1, C2, D, E;
  int i,j;
  const unsigned char* src_chunk;
  unsigned char* dest_chunk;
  unsigned char u,y1,v,y2;
  for (i=0; i<height; i++) {
    src_chunk = src_pixels + i*src_stride;
    dest_chunk = dest_pixels + i*dest_stride;
    for (j=0; j<(width/2); j++) {
      convert_chunk(src_chunk,dest_chunk,1);
      dest_chunk+=8;
      src_chunk+=4;
    }
  }
}