00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "global.h"
00013 #include "memalloc.h"
00014 #include "q_matrix.h"
00015 #include "q_offsets.h"
00016
00017 extern char *GetConfigFileContent (char *Filename, int error_type);
00018
00019 #define MAX_ITEMS_TO_PARSE 2000
00020
00021 int offset4x4_check[6] = { 0, 0, 0, 0, 0, 0 };
00022 int offset8x8_check[6] = { 0, 0, 0, 0, 0, 0 };
00023
00024 static const char OffsetType4x4[15][24] = {
00025 "INTRA4X4_LUMA_INTRA",
00026 "INTRA4X4_CHROMAU_INTRA",
00027 "INTRA4X4_CHROMAV_INTRA",
00028 "INTRA4X4_LUMA_INTERP",
00029 "INTRA4X4_CHROMAU_INTERP",
00030 "INTRA4X4_CHROMAV_INTERP",
00031 "INTRA4X4_LUMA_INTERB",
00032 "INTRA4X4_CHROMAU_INTERB",
00033 "INTRA4X4_CHROMAV_INTERB",
00034 "INTER4X4_LUMA_INTERP",
00035 "INTER4X4_CHROMAU_INTERP",
00036 "INTER4X4_CHROMAV_INTERP",
00037 "INTER4X4_LUMA_INTERB",
00038 "INTER4X4_CHROMAU_INTERB",
00039 "INTER4X4_CHROMAV_INTERB"
00040 };
00041
00042 static const char OffsetType8x8[15][24] = {
00043 "INTRA8X8_LUMA_INTRA",
00044 "INTRA8X8_LUMA_INTERP",
00045 "INTRA8X8_LUMA_INTERB",
00046 "INTER8X8_LUMA_INTERP",
00047 "INTER8X8_LUMA_INTERB",
00048 "INTRA8X8_CHROMAU_INTRA",
00049 "INTRA8X8_CHROMAU_INTERP",
00050 "INTRA8X8_CHROMAU_INTERB",
00051 "INTER8X8_CHROMAU_INTERP",
00052 "INTER8X8_CHROMAU_INTERB",
00053 "INTRA8X8_CHROMAV_INTRA",
00054 "INTRA8X8_CHROMAV_INTERP",
00055 "INTRA8X8_CHROMAV_INTERB",
00056 "INTER8X8_CHROMAV_INTERP",
00057 "INTER8X8_CHROMAV_INTERB"
00058 };
00059
00060 static const short Offset_intra_default_intra[16] = {
00061 682, 682, 682, 682,
00062 682, 682, 682, 682,
00063 682, 682, 682, 682,
00064 682, 682, 682, 682
00065 };
00066
00067 static const short Offset_intra_default_chroma[16] = {
00068 682, 682, 682, 682,
00069 682, 682, 682, 682,
00070 682, 682, 682, 682,
00071 682, 682, 682, 682
00072 };
00073
00074
00075 static const short Offset_intra_default_inter[16] = {
00076 342, 342, 342, 342,
00077 342, 342, 342, 342,
00078 342, 342, 342, 342,
00079 342, 342, 342, 342,
00080 };
00081
00082 static const short Offset_inter_default[16] = {
00083 342, 342, 342, 342,
00084 342, 342, 342, 342,
00085 342, 342, 342, 342,
00086 342, 342, 342, 342,
00087 };
00088
00089 static const short Offset8_intra_default_intra[64] = {
00090 682, 682, 682, 682, 682, 682, 682, 682,
00091 682, 682, 682, 682, 682, 682, 682, 682,
00092 682, 682, 682, 682, 682, 682, 682, 682,
00093 682, 682, 682, 682, 682, 682, 682, 682,
00094 682, 682, 682, 682, 682, 682, 682, 682,
00095 682, 682, 682, 682, 682, 682, 682, 682,
00096 682, 682, 682, 682, 682, 682, 682, 682,
00097 682, 682, 682, 682, 682, 682, 682, 682
00098 };
00099
00100 static const short Offset8_intra_default_chroma[64] = {
00101 682, 682, 682, 682, 682, 682, 682, 682,
00102 682, 682, 682, 682, 682, 682, 682, 682,
00103 682, 682, 682, 682, 682, 682, 682, 682,
00104 682, 682, 682, 682, 682, 682, 682, 682,
00105 682, 682, 682, 682, 682, 682, 682, 682,
00106 682, 682, 682, 682, 682, 682, 682, 682,
00107 682, 682, 682, 682, 682, 682, 682, 682,
00108 682, 682, 682, 682, 682, 682, 682, 682
00109 };
00110
00111 static const short Offset8_intra_default_inter[64] = {
00112 342, 342, 342, 342, 342, 342, 342, 342,
00113 342, 342, 342, 342, 342, 342, 342, 342,
00114 342, 342, 342, 342, 342, 342, 342, 342,
00115 342, 342, 342, 342, 342, 342, 342, 342,
00116 342, 342, 342, 342, 342, 342, 342, 342,
00117 342, 342, 342, 342, 342, 342, 342, 342,
00118 342, 342, 342, 342, 342, 342, 342, 342,
00119 342, 342, 342, 342, 342, 342, 342, 342
00120 };
00121
00122 static const short Offset8_inter_default[64] = {
00123 342, 342, 342, 342, 342, 342, 342, 342,
00124 342, 342, 342, 342, 342, 342, 342, 342,
00125 342, 342, 342, 342, 342, 342, 342, 342,
00126 342, 342, 342, 342, 342, 342, 342, 342,
00127 342, 342, 342, 342, 342, 342, 342, 342,
00128 342, 342, 342, 342, 342, 342, 342, 342,
00129 342, 342, 342, 342, 342, 342, 342, 342,
00130 342, 342, 342, 342, 342, 342, 342, 342
00131 };
00132
00133
00134
00135 static void InitOffsetParam (QuantParameters *p_Quant, InputParameters *p_Inp);
00136
00137
00138
00139
00140
00141
00142 static void allocate_QOffsets (QuantParameters *p_Quant, InputParameters *p_Inp)
00143 {
00144 int max_bitdepth = imax(p_Inp->output.bit_depth[0], p_Inp->output.bit_depth[1]);
00145 int max_qp = (3 + 6*(max_bitdepth));
00146
00147
00148 if (p_Inp->AdaptRoundingFixed)
00149 {
00150 get_mem3Dshort(&p_Quant->OffsetList4x4, 1, 25, 16);
00151 get_mem3Dshort(&p_Quant->OffsetList8x8, 1, 15, 64);
00152 }
00153 else
00154 {
00155 get_mem3Dshort(&p_Quant->OffsetList4x4, max_qp + 1, 25, 16);
00156 get_mem3Dshort(&p_Quant->OffsetList8x8, max_qp + 1, 15, 64);
00157 }
00158
00159 get_mem2Dshort(&p_Quant->OffsetList4x4input, 25, 16);
00160 get_mem2Dshort(&p_Quant->OffsetList8x8input, 15, 64);
00161 }
00162
00163 static inline void update_q_offset4x4(LevelQuantParams **q_params, short *offsetList, int q_bits)
00164 {
00165 int i, j;
00166 short *p_list = &offsetList[0];
00167 for (j = 0; j < 4; j++)
00168 {
00169 for (i = 0; i < 4; i++)
00170 {
00171 q_params[j][i].OffsetComp = (int) *p_list++ << q_bits;
00172 }
00173 }
00174 }
00175
00176 static inline void update_q_offset8x8(LevelQuantParams **q_params, short *offsetList, int q_bits)
00177 {
00178 int i, j;
00179 short *p_list;
00180 for (j = 0; j < 8; j++)
00181 {
00182 p_list = &offsetList[j << 3];
00183 for (i = 0; i < 8; i++)
00184 {
00185 q_params[j][i].OffsetComp = (int) *p_list++ << q_bits;
00186 }
00187 }
00188 }
00189
00190
00191
00192
00193
00194
00195
00196 void free_QOffsets (QuantParameters *p_Quant, InputParameters *p_Inp)
00197 {
00198 if (p_Inp->AdaptRoundingFixed)
00199 {
00200 free_mem3Dshort(p_Quant->OffsetList8x8);
00201 free_mem3Dshort(p_Quant->OffsetList4x4);
00202 }
00203 else
00204 {
00205 free_mem3Dshort(p_Quant->OffsetList8x8);
00206 free_mem3Dshort(p_Quant->OffsetList4x4);
00207 }
00208
00209 free_mem2Dshort(p_Quant->OffsetList8x8input);
00210 free_mem2Dshort(p_Quant->OffsetList4x4input);
00211 }
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228 int CheckOffsetParameterName (char *s, int *type)
00229 {
00230 int i = 0;
00231
00232 *type = 0;
00233 while ((OffsetType4x4[i] != NULL) && (i < 15))
00234 {
00235 if (0 == strcmp (OffsetType4x4[i], s))
00236 return i;
00237 else
00238 i++;
00239 }
00240
00241 i = 0;
00242 *type = 1;
00243 while ((OffsetType8x8[i] != NULL) && (i < 15))
00244 {
00245 if (0 == strcmp (OffsetType8x8[i], s))
00246 return i;
00247 else
00248 i++;
00249 }
00250
00251 return -1;
00252 }
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 void ParseQOffsetMatrix (QuantParameters *p_Quant, char *buf, int bufsize)
00267 {
00268 char *items[MAX_ITEMS_TO_PARSE] = {NULL};
00269 int MapIdx;
00270 int item = 0;
00271 int InString = 0, InItem = 0;
00272 char *p = buf;
00273 char *bufend = &buf[bufsize];
00274 int IntContent;
00275 int i, j, range, type, cnt;
00276 short *OffsetList;
00277
00278 while (p < bufend)
00279 {
00280 switch (*p)
00281 {
00282
00283
00284
00285 case '#':
00286 *p = '\0';
00287 while ((*p != '\n' && *p != '\r') && p < bufend)
00288 p++;
00289 InString = 0;
00290 InItem = 0;
00291 break;
00292 case '\n':
00293 case '\r':
00294 InItem = 0;
00295 InString = 0;
00296 *p++ = '\0';
00297 break;
00298 case ' ':
00299 case '\t':
00300 if (InString)
00301 p++;
00302 else
00303 {
00304 *p++ = '\0';
00305 InItem = 0;
00306 }
00307 break;
00308
00309 case '"':
00310 *p++ = '\0';
00311 if (!InString)
00312 {
00313 items[item++] = p;
00314 InItem = ~InItem;
00315 }
00316 else
00317 InItem = 0;
00318 InString = ~InString;
00319 break;
00320
00321 case ',':
00322 p++;
00323 InItem = 0;
00324 break;
00325
00326 default:
00327 if (!InItem)
00328 {
00329 items[item++] = p;
00330 InItem = ~InItem;
00331 }
00332 p++;
00333 }
00334 }
00335
00336 item--;
00337
00338 for (i = 0; i < item; i += cnt)
00339 {
00340 cnt = 0;
00341 if (0 > (MapIdx = CheckOffsetParameterName (items[i + cnt], &type)))
00342 {
00343 snprintf (errortext, ET_SIZE,
00344 " Parsing error in quantization offset config file: Parameter Name '%s' not recognized.",
00345 items[i + cnt]);
00346 error (errortext, 300);
00347 }
00348 cnt++;
00349 if (strcmp ("=", items[i + cnt]))
00350 {
00351 snprintf (errortext, ET_SIZE,
00352 " Parsing error in quantization offset config file: '=' expected as the second token in each item.");
00353 error (errortext, 300);
00354 }
00355 cnt++;
00356
00357 if (!type)
00358 {
00359 range = 16;
00360 OffsetList = p_Quant->OffsetList4x4input[MapIdx];
00361 offset4x4_check[MapIdx] = 1;
00362 }
00363 else
00364 {
00365 range = 64;
00366 OffsetList = p_Quant->OffsetList8x8input[MapIdx];
00367 offset8x8_check[MapIdx] = 1;
00368 }
00369
00370 for (j = 0; j < range; j++)
00371 {
00372 if (1 != sscanf (items[i + cnt + j], "%d", &IntContent))
00373 {
00374 snprintf (errortext, ET_SIZE,
00375 " Parsing error in quantization offset file: Expected numerical value for Parameter of %s, found '%s'.",
00376 items[i], items[i + cnt + j]);
00377 error (errortext, 300);
00378 }
00379
00380 OffsetList[j] = (short) IntContent;
00381 }
00382 cnt += j;
00383 printf (".");
00384 }
00385 }
00386
00387
00388
00389
00390
00391
00392
00393
00394 void Init_QOffsetMatrix (ImageParameters *p_Img, InputParameters *p_Inp)
00395 {
00396 char *content;
00397
00398 allocate_QOffsets (p_Img->p_Quant, p_Inp);
00399
00400 if (p_Inp->OffsetMatrixPresentFlag)
00401 {
00402 printf ("Parsing Quantization Offset Matrix file %s ",
00403 p_Inp->QOffsetMatrixFile);
00404 content = GetConfigFileContent (p_Inp->QOffsetMatrixFile, 0);
00405 if (content != '\0')
00406 ParseQOffsetMatrix (p_Img->p_Quant, content, strlen (content));
00407 else
00408 {
00409 printf
00410 ("\nError: %s\nProceeding with default values for all matrices.",
00411 errortext);
00412 p_Inp->OffsetMatrixPresentFlag = 0;
00413 }
00414
00415 printf ("\n");
00416
00417 free (content);
00418 }
00419
00420 InitOffsetParam (p_Img->p_Quant, p_Inp);
00421 }
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436 static void InitOffsetParam (QuantParameters *p_Quant, InputParameters *p_Inp)
00437 {
00438 int i, k;
00439 int max_qp_luma = (4 + 6*(p_Inp->output.bit_depth[0]));
00440 int max_qp_cr = (4 + 6*(p_Inp->output.bit_depth[1]));
00441
00442 for (i = 0; i < (p_Inp->AdaptRoundingFixed ? 1 : imax(max_qp_luma, max_qp_cr)); i++)
00443 {
00444 if (p_Inp->OffsetMatrixPresentFlag)
00445 {
00446 memcpy(&(p_Quant->OffsetList4x4[i][0][0]),&(p_Quant->OffsetList4x4input[0][0]), 400 * sizeof(short));
00447 memcpy(&(p_Quant->OffsetList8x8[i][0][0]),&(p_Quant->OffsetList8x8input[0][0]), 960 * sizeof(short));
00448 }
00449 else
00450 {
00451
00452 memcpy(&(p_Quant->OffsetList4x4[i][0][0]),&(Offset_intra_default_intra[0]), 16 * sizeof(short));
00453 for (k = 1; k < 3; k++)
00454 memcpy(&(p_Quant->OffsetList4x4[i][k][0]),&(Offset_intra_default_chroma[0]), 16 * sizeof(short));
00455 for (k = 3; k < 9; k++)
00456 memcpy(&(p_Quant->OffsetList4x4[i][k][0]),&(Offset_intra_default_inter[0]), 16 * sizeof(short));
00457 for (k = 9; k < 25; k++)
00458 memcpy(&(p_Quant->OffsetList4x4[i][k][0]),&(Offset_inter_default[0]), 16 * sizeof(short));
00459
00460
00461 memcpy(&(p_Quant->OffsetList8x8[i][0][0]),&(Offset8_intra_default_intra[0]), 64 * sizeof(short));
00462 for (k = 1; k < 3; k++)
00463 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_intra_default_inter[0]), 64 * sizeof(short));
00464 for (k = 3; k < 5; k++)
00465 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_inter_default[0]), 64 * sizeof(short));
00466
00467
00468 memcpy(&(p_Quant->OffsetList8x8[i][5][0]),&(Offset8_intra_default_chroma[0]), 64 * sizeof(short));
00469 for (k = 6; k < 8; k++)
00470 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_intra_default_inter[0]), 64 * sizeof(short));
00471 for (k = 8; k < 10; k++)
00472 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_inter_default[0]), 64 * sizeof(short));
00473
00474
00475 memcpy(&(p_Quant->OffsetList8x8[i][10][0]),&(Offset8_intra_default_chroma[0]), 64 * sizeof(short));
00476 for (k = 11; k < 13; k++)
00477 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_intra_default_inter[0]), 64 * sizeof(short));
00478 for (k = 13; k < 15; k++)
00479 memcpy(&(p_Quant->OffsetList8x8[i][k][0]),&(Offset8_inter_default[0]), 64 * sizeof(short));
00480 }
00481 }
00482 }
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497 void CalculateOffset4x4Param (ImageParameters *p_Img, InputParameters *p_Inp)
00498 {
00499 QuantParameters *p_Quant = p_Img->p_Quant;
00500 int k;
00501 int qp_per, qp;
00502 short **OffsetList;
00503 int img_type = (p_Img->type == SI_SLICE ? I_SLICE : (p_Img->type == SP_SLICE ? P_SLICE : p_Img->type));
00504
00505 int max_qp_scale = imax(p_Img->bitdepth_luma_qp_scale, p_Img->bitdepth_chroma_qp_scale);
00506 int max_qp = 51 + max_qp_scale;
00507
00508 p_Img->AdaptRndWeight = p_Inp->AdaptRndWFactor [p_Img->nal_reference_idc != 0][img_type];
00509 p_Img->AdaptRndCrWeight = p_Inp->AdaptRndCrWFactor[p_Img->nal_reference_idc != 0][img_type];
00510
00511 if (img_type == I_SLICE )
00512 {
00513 for (qp = 0; qp < max_qp + 1; qp++)
00514 {
00515 k = p_Quant->qp_per_matrix [qp];
00516 qp_per = Q_BITS + k - OffsetBits;
00517 OffsetList = p_Quant->OffsetList4x4[p_Inp->AdaptRoundingFixed ? 0 : qp];
00518 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00519
00520
00521 update_q_offset4x4(p_Quant->q_params_4x4[0][1][qp], p_Quant->OffsetList4x4[k][ 0], qp_per);
00522
00523 update_q_offset4x4(p_Quant->q_params_4x4[1][1][qp], p_Quant->OffsetList4x4[k][ 1], qp_per);
00524
00525 update_q_offset4x4(p_Quant->q_params_4x4[2][1][qp], p_Quant->OffsetList4x4[k][ 2], qp_per);
00526 }
00527 }
00528 else if (img_type == B_SLICE)
00529 {
00530 for (qp = 0; qp < max_qp + 1; qp++)
00531 {
00532 k = p_Quant->qp_per_matrix [qp];
00533 qp_per = Q_BITS + k - OffsetBits;
00534 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00535
00536
00537 update_q_offset4x4(p_Quant->q_params_4x4[0][0][qp], p_Quant->OffsetList4x4[k][12], qp_per);
00538
00539 update_q_offset4x4(p_Quant->q_params_4x4[0][1][qp], p_Quant->OffsetList4x4[k][ 6], qp_per);
00540
00541 update_q_offset4x4(p_Quant->q_params_4x4[1][0][qp], p_Quant->OffsetList4x4[k][13], qp_per);
00542
00543 update_q_offset4x4(p_Quant->q_params_4x4[1][1][qp], p_Quant->OffsetList4x4[k][ 7], qp_per);
00544
00545 update_q_offset4x4(p_Quant->q_params_4x4[2][0][qp], p_Quant->OffsetList4x4[k][14], qp_per);
00546
00547 update_q_offset4x4(p_Quant->q_params_4x4[2][1][qp], p_Quant->OffsetList4x4[k][ 8], qp_per);
00548 }
00549 }
00550 else
00551 {
00552 for (qp = 0; qp < max_qp + 1; qp++)
00553 {
00554 k = p_Quant->qp_per_matrix [qp];
00555 qp_per = Q_BITS + k - OffsetBits;
00556 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00557
00558
00559 update_q_offset4x4(p_Quant->q_params_4x4[0][0][qp], p_Quant->OffsetList4x4[k][ 9], qp_per);
00560
00561 update_q_offset4x4(p_Quant->q_params_4x4[0][1][qp], p_Quant->OffsetList4x4[k][ 3], qp_per);
00562
00563 update_q_offset4x4(p_Quant->q_params_4x4[1][0][qp], p_Quant->OffsetList4x4[k][10], qp_per);
00564
00565 update_q_offset4x4(p_Quant->q_params_4x4[1][1][qp], p_Quant->OffsetList4x4[k][ 4], qp_per);
00566
00567 update_q_offset4x4(p_Quant->q_params_4x4[2][0][qp], p_Quant->OffsetList4x4[k][11], qp_per);
00568
00569 update_q_offset4x4(p_Quant->q_params_4x4[2][1][qp], p_Quant->OffsetList4x4[k][ 5], qp_per);
00570 }
00571 }
00572 }
00573
00574
00575
00576
00577
00578
00579
00580
00581 void CalculateOffset8x8Param (ImageParameters *p_Img, InputParameters *p_Inp)
00582 {
00583 QuantParameters *p_Quant = p_Img->p_Quant;
00584 int k;
00585 int q_bits, qp;
00586
00587 int max_qp_scale = imax(p_Img->bitdepth_luma_qp_scale, p_Img->bitdepth_chroma_qp_scale);
00588 int max_qp = 51 + max_qp_scale;
00589
00590 if (p_Img->type == I_SLICE || p_Img->type == SI_SLICE )
00591 {
00592 for (qp = 0; qp < max_qp + 1; qp++)
00593 {
00594 q_bits = Q_BITS_8 + p_Quant->qp_per_matrix[qp] - OffsetBits;
00595 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00596
00597 update_q_offset8x8(p_Quant->q_params_8x8[0][1][qp], p_Quant->OffsetList8x8[k][0], q_bits);
00598
00599 update_q_offset8x8(p_Quant->q_params_8x8[1][1][qp], p_Quant->OffsetList8x8[k][5], q_bits);
00600
00601 update_q_offset8x8(p_Quant->q_params_8x8[2][1][qp], p_Quant->OffsetList8x8[k][10], q_bits);
00602 }
00603 }
00604 else if ((p_Img->type == P_SLICE) || (p_Img->type == SP_SLICE))
00605 {
00606 for (qp = 0; qp < max_qp + 1; qp++)
00607 {
00608 q_bits = Q_BITS_8 + p_Quant->qp_per_matrix[qp] - OffsetBits;
00609 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00610
00611
00612 update_q_offset8x8(p_Quant->q_params_8x8[0][0][qp], p_Quant->OffsetList8x8[k][3], q_bits);
00613
00614 update_q_offset8x8(p_Quant->q_params_8x8[0][1][qp], p_Quant->OffsetList8x8[k][1], q_bits);
00615
00616 update_q_offset8x8(p_Quant->q_params_8x8[1][0][qp], p_Quant->OffsetList8x8[k][8], q_bits);
00617
00618 update_q_offset8x8(p_Quant->q_params_8x8[1][1][qp], p_Quant->OffsetList8x8[k][6], q_bits);
00619
00620 update_q_offset8x8(p_Quant->q_params_8x8[2][0][qp], p_Quant->OffsetList8x8[k][13], q_bits);
00621
00622 update_q_offset8x8(p_Quant->q_params_8x8[2][1][qp], p_Quant->OffsetList8x8[k][11], q_bits);
00623 }
00624 }
00625 else
00626 {
00627 for (qp = 0; qp < max_qp + 1; qp++)
00628 {
00629 q_bits = Q_BITS_8 + p_Quant->qp_per_matrix[qp] - OffsetBits;
00630 k = p_Inp->AdaptRoundingFixed ? 0 : qp;
00631
00632
00633 update_q_offset8x8(p_Quant->q_params_8x8[0][0][qp], p_Quant->OffsetList8x8[k][4], q_bits);
00634
00635 update_q_offset8x8(p_Quant->q_params_8x8[0][1][qp], p_Quant->OffsetList8x8[k][2], q_bits);
00636
00637 update_q_offset8x8(p_Quant->q_params_8x8[1][0][qp], p_Quant->OffsetList8x8[k][9], q_bits);
00638
00639 update_q_offset8x8(p_Quant->q_params_8x8[1][1][qp], p_Quant->OffsetList8x8[k][7], q_bits);
00640
00641 update_q_offset8x8(p_Quant->q_params_8x8[2][0][qp], p_Quant->OffsetList8x8[k][14], q_bits);
00642
00643 update_q_offset8x8(p_Quant->q_params_8x8[2][1][qp], p_Quant->OffsetList8x8[k][12], q_bits);
00644 }
00645 }
00646 }