summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2011-11-24 19:31:15 +0800
committerRockchip2011-11-24 19:31:15 +0800
commit3b0b86aa3ffd2509e1f46646fe2232b55c67e97e (patch)
treece97eef8f1adc7733732ea82f5f5343cb4aee710
parente206ede47ecf6e32056425d30aa437eccdda1fb3 (diff)
push encoder header file
-rw-r--r--release/encode_release/hw_jpegenc.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/release/encode_release/hw_jpegenc.h b/release/encode_release/hw_jpegenc.h
new file mode 100644
index 0000000..4b04bb6
--- /dev/null
+++ b/release/encode_release/hw_jpegenc.h
@@ -0,0 +1,120 @@
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifndef __RK_HW_JPEGENC_H__
+#define __RK_HW_JPEGENC_H__
+
+typedef enum
+{
+ JPEGENC_YUV420_P = 0, //JPEGENC_YUV420_PLANAR; /* YYYY... UUUU... VVVV */
+ JPEGENC_YUV420_SP = 1, //JPEGENC_YUV420_SEMIPLANAR; /* YYYY... UVUVUV... */
+ JPEGENC_YUV422_YUYV = 2, //JPEGENC_YUV422_INTERLEAVED_YUYV; /* YUYVYUYV... */
+ JPEGENC_YUV422_UYVY = 3, //JPEGENC_YUV422_INTERLEAVED_UYVY; /* UYVYUYVY... */
+ HWJPEGENC_RGB565 = 4,
+ HWJPEGENC_RGB888 = 10
+} JpegEncType;
+
+typedef struct{
+ uint32_t num;
+ uint32_t denom;
+}rat_t;
+
+typedef struct{
+ /*IFD0*/
+ char *maker;//manufacturer of digicam, just to adjust to make inPhybusAddr to align to 64
+ int makerchars;//length of maker, contain the end '\0', so equal strlen(maker)+1
+ char *modelstr;//model number of digicam
+ int modelchars;//length of modelstr, contain the end '\0'
+ int Orientation;//usually 1
+ //XResolution, YResolution; if need be not 72, TODO...
+ char DateTime[20];//must be 20 chars-> yyyy:MM:dd0x20hh:mm:ss'\0'
+ /*Exif SubIFD*/
+ rat_t ExposureTime;//such as 1/400=0.0025s
+ rat_t ApertureFNumber;//actual f-number
+ int ISOSpeedRatings;//CCD sensitivity equivalent to Ag-Hr film speedrate
+ rat_t CompressedBitsPerPixel;
+ rat_t ShutterSpeedValue;
+ rat_t ApertureValue;
+ rat_t ExposureBiasValue;
+ rat_t MaxApertureValue;
+ int MeteringMode;
+ int Flash;
+ rat_t FocalLength;
+ rat_t FocalPlaneXResolution;
+ rat_t FocalPlaneYResolution;
+ int SensingMethod;//2 means 1 chip color area sensor
+ int FileSource;//3 means the image source is digital still camera
+ int CustomRendered;//0
+ int ExposureMode;//0
+ int WhiteBalance;//0
+ rat_t DigitalZoomRatio;// inputw/inputw
+ //int FocalLengthIn35mmFilm;
+ int SceneCaptureType;//0
+
+}RkExifInfo;
+
+typedef struct
+{
+ /*GPS IFD*/
+ //int GpsInfoPrecent;
+ char GPSLatitudeRef[2];//'N\0' 'S\0'
+ rat_t GPSLatitude[3];
+ char GPSLongitudeRef[2];//'E\0' 'W\0'
+ rat_t GPSLongitude[3];
+ char GPSAltitudeRef;
+ rat_t GPSAltitude;
+ rat_t GpsTimeStamp[3];
+ char GpsDateStamp[11];//"YYYY:MM:DD\0"
+
+ char *GPSProcessingMethod;//[101]
+ int GpsProcessingMethodchars;//length of GpsProcessingMethod
+}RkGPSInfo;
+
+typedef enum{
+ DEGREE_0 = 0,
+ DEGREE_90 = 1,
+ DEGREE_270 = 2,
+ DEGREE_180 = 3
+}JpegEncDegree;
+typedef struct
+{
+ int frameHeader;//if 1, insert all headers(SOI,APP0,DQT,SOF0,DRI,DHT,SOS);if 0, insert only APP0 and SOS headers
+ JpegEncDegree rotateDegree;//if degree is 90 or 270, check that width and height and thumbwidth and thumbheight must % 16 = 0.
+ int y_rgb_addr;
+ int uv_addr;
+ int yuvaddrfor180;//if rotate 180, we need another phy buf. use ipp to do rotating 180. TO DO by soft handler
+ int inputW;//inputW >= (encodedW+15)&(~15) and inputW%16=0(for YUV420)
+ int inputH;//inputH >= encodedH and inputH%8=0(for YUV420)
+ //int encodedW;//encodedW%4=0, >= 96
+ //int encodedH;//encodedH%2=0, >=32
+ JpegEncType type;
+ int qLvl;
+
+ int doThumbNail;//insert thumbnail at APP0 extension if motionjpeg, else at APP1 extension(exifinfo should not be null)
+ const void *thumbData;//if thumbData is NULL, do scale, the type above can be JPEGENC_YUV420_SP only
+ int thumbDataLen;
+ int thumbW;//if thumbData is not NULL, ignore this. even. [96,255]
+ int thumbH;//thumbW*thumbH % 8 = 0
+ int thumbqLvl;
+ RkExifInfo *exifInfo;//if dothumbnail and thumbdata is null and insert all header, this must not be null
+ RkGPSInfo *gpsInfo;//be null when gps is not set, else not be null
+}JpegEncInInfo;
+
+typedef struct
+{
+ int outBufPhyAddr;
+ unsigned char* outBufVirAddr;
+ int finalOffset;//out invalid data offset to outBufAddr above
+ int outBuflen;//1024 + thumbnail length + init jpeg length + thumbnaillength(tmp buf)
+ int jpegFileLen;
+ int (*cacheflush)(int buf_type, int offset, int len);
+}JpegEncOutInfo;
+
+extern int hw_jpeg_encode(JpegEncInInfo *inInfo, JpegEncOutInfo *outInfo);
+extern int doSoftScale(uint8_t *srcy, uint8_t *srcuv, int srcw, int srch, uint8_t *dsty, uint8_t *dstuv, int dstw, int dsth, int flag);
+#endif
+#ifdef __cplusplus
+}
+#endif