Mercurial > libpostproc.hg
comparison postprocess.c @ 78:47ff4bd209cd libpostproc
const
| author | michael |
|---|---|
| date | Sat, 02 Feb 2008 21:24:54 +0000 |
| parents | d2cf9a69d443 |
| children | 8181b013dafa |
comparison
equal
deleted
inserted
replaced
| 77:13e4f6ebb206 | 78:47ff4bd209cd |
|---|---|
| 641 #include "postprocess_template.c" | 641 #include "postprocess_template.c" |
| 642 #endif | 642 #endif |
| 643 | 643 |
| 644 // minor note: the HAVE_xyz is messed up after that line so do not use it. | 644 // minor note: the HAVE_xyz is messed up after that line so do not use it. |
| 645 | 645 |
| 646 static inline void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, | 646 static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, |
| 647 QP_STORE_T QPs[], int QPStride, int isColor, pp_mode_t *vm, pp_context_t *vc) | 647 const QP_STORE_T QPs[], int QPStride, int isColor, pp_mode_t *vm, pp_context_t *vc) |
| 648 { | 648 { |
| 649 PPContext *c= (PPContext *)vc; | 649 PPContext *c= (PPContext *)vc; |
| 650 PPMode *ppMode= (PPMode *)vm; | 650 PPMode *ppMode= (PPMode *)vm; |
| 651 c->ppMode= *ppMode; //FIXME | 651 c->ppMode= *ppMode; //FIXME |
| 652 | 652 |
| 1019 memset(c, 0, sizeof(PPContext)); | 1019 memset(c, 0, sizeof(PPContext)); |
| 1020 | 1020 |
| 1021 av_free(c); | 1021 av_free(c); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 void pp_postprocess(uint8_t * src[3], int srcStride[3], | 1024 void pp_postprocess(const uint8_t * src[3], const int srcStride[3], |
| 1025 uint8_t * dst[3], int dstStride[3], | 1025 uint8_t * dst[3], const int dstStride[3], |
| 1026 int width, int height, | 1026 int width, int height, |
| 1027 QP_STORE_T *QP_store, int QPStride, | 1027 const QP_STORE_T *QP_store, int QPStride, |
| 1028 pp_mode_t *vm, void *vc, int pict_type) | 1028 pp_mode_t *vm, void *vc, int pict_type) |
| 1029 { | 1029 { |
| 1030 int mbWidth = (width+15)>>4; | 1030 int mbWidth = (width+15)>>4; |
| 1031 int mbHeight= (height+15)>>4; | 1031 int mbHeight= (height+15)>>4; |
| 1032 PPMode *mode = (PPMode*)vm; | 1032 PPMode *mode = (PPMode*)vm; |
| 1044 { | 1044 { |
| 1045 int i; | 1045 int i; |
| 1046 QP_store= c->forcedQPTable; | 1046 QP_store= c->forcedQPTable; |
| 1047 absQPStride = QPStride = 0; | 1047 absQPStride = QPStride = 0; |
| 1048 if(mode->lumMode & FORCE_QUANT) | 1048 if(mode->lumMode & FORCE_QUANT) |
| 1049 for(i=0; i<mbWidth; i++) QP_store[i]= mode->forcedQuant; | 1049 for(i=0; i<mbWidth; i++) c->forcedQPTable[i]= mode->forcedQuant; |
| 1050 else | 1050 else |
| 1051 for(i=0; i<mbWidth; i++) QP_store[i]= 1; | 1051 for(i=0; i<mbWidth; i++) c->forcedQPTable[i]= 1; |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 if(pict_type & PP_PICT_TYPE_QP2){ | 1054 if(pict_type & PP_PICT_TYPE_QP2){ |
| 1055 int i; | 1055 int i; |
| 1056 const int count= mbHeight * absQPStride; | 1056 const int count= mbHeight * absQPStride; |
| 1057 for(i=0; i<(count>>2); i++){ | 1057 for(i=0; i<(count>>2); i++){ |
| 1058 ((uint32_t*)c->stdQPTable)[i] = (((uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F; | 1058 ((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F; |
| 1059 } | 1059 } |
| 1060 for(i<<=2; i<count; i++){ | 1060 for(i<<=2; i<count; i++){ |
| 1061 c->stdQPTable[i] = QP_store[i]>>1; | 1061 c->stdQPTable[i] = QP_store[i]>>1; |
| 1062 } | 1062 } |
| 1063 QP_store= c->stdQPTable; | 1063 QP_store= c->stdQPTable; |
| 1079 { | 1079 { |
| 1080 if (QPStride >= 0) { | 1080 if (QPStride >= 0) { |
| 1081 int i; | 1081 int i; |
| 1082 const int count= mbHeight * QPStride; | 1082 const int count= mbHeight * QPStride; |
| 1083 for(i=0; i<(count>>2); i++){ | 1083 for(i=0; i<(count>>2); i++){ |
| 1084 ((uint32_t*)c->nonBQPTable)[i] = ((uint32_t*)QP_store)[i] & 0x3F3F3F3F; | 1084 ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; |
| 1085 } | 1085 } |
| 1086 for(i<<=2; i<count; i++){ | 1086 for(i<<=2; i<count; i++){ |
| 1087 c->nonBQPTable[i] = QP_store[i] & 0x3F; | 1087 c->nonBQPTable[i] = QP_store[i] & 0x3F; |
| 1088 } | 1088 } |
| 1089 } else { | 1089 } else { |
