2019-11-20 00:59:49 +00:00
|
|
|
/*
|
2019-01-16 19:40:08 +00:00
|
|
|
* cuAmpcorChunk.h
|
|
|
|
* Purpose: a group of chips processed at the same time
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CUAMPCORCHUNK_H
|
|
|
|
#define __CUAMPCORCHUNK_H
|
|
|
|
|
2019-11-20 00:59:49 +00:00
|
|
|
#include "GDALImage.h"
|
2019-01-16 19:40:08 +00:00
|
|
|
#include "cuArrays.h"
|
|
|
|
#include "cuAmpcorParameter.h"
|
|
|
|
#include "cuOverSampler.h"
|
|
|
|
#include "cuSincOverSampler.h"
|
|
|
|
#include "cuCorrFrequency.h"
|
|
|
|
|
|
|
|
class cuAmpcorChunk{
|
|
|
|
private:
|
|
|
|
int idxChunkDown;
|
|
|
|
int idxChunkAcross;
|
|
|
|
int idxChunk;
|
|
|
|
int nWindowsDown;
|
|
|
|
int nWindowsAcross;
|
|
|
|
|
|
|
|
int devId;
|
2019-11-20 00:59:49 +00:00
|
|
|
cudaStream_t stream;
|
|
|
|
|
2020-07-02 19:40:49 +00:00
|
|
|
GDALImage *referenceImage;
|
|
|
|
GDALImage *secondaryImage;
|
2019-01-16 19:40:08 +00:00
|
|
|
cuAmpcorParameter *param;
|
|
|
|
cuArrays<float2> *offsetImage;
|
|
|
|
cuArrays<float> *snrImage;
|
2019-11-20 00:59:49 +00:00
|
|
|
cuArrays<float3> *covImage;
|
|
|
|
|
|
|
|
// gpu buffer
|
2020-07-02 19:40:49 +00:00
|
|
|
cuArrays<float2> * c_referenceChunkRaw, * c_secondaryChunkRaw;
|
|
|
|
cuArrays<float> * r_referenceChunkRaw, * r_secondaryChunkRaw;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
|
|
|
// gpu windows raw data
|
2020-07-02 19:40:49 +00:00
|
|
|
cuArrays<float2> * c_referenceBatchRaw, * c_secondaryBatchRaw, * c_secondaryBatchZoomIn;
|
|
|
|
cuArrays<float> * r_referenceBatchRaw, * r_secondaryBatchRaw;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
|
|
|
// gpu windows oversampled data
|
2020-07-02 19:40:49 +00:00
|
|
|
cuArrays<float2> * c_referenceBatchOverSampled, * c_secondaryBatchOverSampled;
|
|
|
|
cuArrays<float> * r_referenceBatchOverSampled, * r_secondaryBatchOverSampled;
|
2019-01-16 19:40:08 +00:00
|
|
|
cuArrays<float> * r_corrBatchRaw, * r_corrBatchZoomIn, * r_corrBatchZoomInOverSampled, * r_corrBatchZoomInAdjust;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
cuArrays<int> *ChunkOffsetDown, *ChunkOffsetAcross;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2020-07-02 19:40:49 +00:00
|
|
|
cuOverSamplerC2C *referenceBatchOverSampler, *secondaryBatchOverSampler;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
cuOverSamplerR2R *corrOverSampler;
|
2019-11-20 00:59:49 +00:00
|
|
|
cuSincOverSamplerR2R *corrSincOverSampler;
|
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
//for frequency domain
|
|
|
|
cuFreqCorrelator *cuCorrFreqDomain, *cuCorrFreqDomain_OverSampled;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
cuArrays<int2> *offsetInit;
|
|
|
|
cuArrays<int2> *offsetZoomIn;
|
|
|
|
cuArrays<float2> *offsetFinal;
|
2020-11-12 23:02:44 +00:00
|
|
|
cuArrays<int2> *maxLocShift; //record the maxloc from the extract center
|
2019-11-20 00:59:49 +00:00
|
|
|
cuArrays<float> *corrMaxValue;
|
|
|
|
|
|
|
|
|
|
|
|
//SNR estimation
|
|
|
|
|
|
|
|
cuArrays<float> *r_corrBatchRawZoomIn;
|
|
|
|
cuArrays<float> *r_corrBatchSum;
|
|
|
|
cuArrays<int> *i_corrBatchZoomInValid, *i_corrBatchValidCount;
|
|
|
|
|
|
|
|
cuArrays<float> *r_snrValue;
|
2019-01-16 19:40:08 +00:00
|
|
|
|
|
|
|
cuArrays<int2> *i_maxloc;
|
|
|
|
cuArrays<float> *r_maxval;
|
2019-11-20 00:59:49 +00:00
|
|
|
|
|
|
|
// Varince estimation.
|
|
|
|
cuArrays<float3> *r_covValue;
|
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
public:
|
|
|
|
cuAmpcorChunk() {}
|
2020-07-02 19:40:49 +00:00
|
|
|
//cuAmpcorChunk(cuAmpcorParameter *param_, SlcImage *reference_, SlcImage *secondary_);
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
void setIndex(int idxDown_, int idxAcross_);
|
|
|
|
|
2020-07-02 19:40:49 +00:00
|
|
|
cuAmpcorChunk(cuAmpcorParameter *param_, GDALImage *reference_, GDALImage *secondary_, cuArrays<float2> *offsetImage_,
|
2020-11-12 23:02:44 +00:00
|
|
|
cuArrays<float> *snrImage_, cuArrays<float3> *covImage_, cudaStream_t stream_);
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
|
2020-07-02 19:40:49 +00:00
|
|
|
void loadReferenceChunk();
|
|
|
|
void loadSecondaryChunk();
|
2019-01-16 19:40:08 +00:00
|
|
|
void getRelativeOffset(int *rStartPixel, const int *oStartPixel, int diff);
|
2019-11-20 00:59:49 +00:00
|
|
|
|
|
|
|
~cuAmpcorChunk();
|
|
|
|
|
|
|
|
void run(int, int);
|
2019-01-16 19:40:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-20 00:59:49 +00:00
|
|
|
#endif
|