[cvs] / xvidcore / src / encoder.c Repository:
ViewVC logotype

Diff of /xvidcore/src/encoder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48, Mon Jun 24 09:53:17 2002 UTC revision 1.60, Sun Jul 21 03:41:44 2002 UTC
# Line 32  Line 32 
32   *   *
33   *  History   *  History
34   *   *
35     *  10.07.2002  added BFRAMES_DEC_DEBUG support
36     *              MinChen <chenm001@163.com>
37   *      20.06.2002 bframe patch   *      20.06.2002 bframe patch
38   *  08.05.2002 fix some problem in DEBUG mode;   *  08.05.2002 fix some problem in DEBUG mode;
39   *             MinChen <chenm001@163.com>   *             MinChen <chenm001@163.com>
# Line 66  Line 68 
68  #include "quant/quant_matrix.h"  #include "quant/quant_matrix.h"
69  #include "utils/mem_align.h"  #include "utils/mem_align.h"
70    
71    #ifdef _SMP
72    #include "motion/smp_motion_est.h"
73    #endif
74  /*****************************************************************************  /*****************************************************************************
75   * Local macros   * Local macros
76   ****************************************************************************/   ****************************************************************************/
# Line 207  Line 212 
212          if (pParam->max_key_interval == 0)          if (pParam->max_key_interval == 0)
213                  pParam->max_key_interval = 10 * pParam->fincr / pParam->fbase;                  pParam->max_key_interval = 10 * pParam->fincr / pParam->fbase;
214    
   
215          pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE);          pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE);
216          if (pEnc == NULL)          if (pEnc == NULL)
217                  return XVID_ERR_MEMORY;                  return XVID_ERR_MEMORY;
# Line 232  Line 236 
236    
237          pEnc->mbParam.m_quant_type = H263_QUANT;          pEnc->mbParam.m_quant_type = H263_QUANT;
238    
239    #ifdef _SMP
240            pEnc->mbParam.num_threads = MIN(pParam->num_threads, MAXNUMTHREADS);
241    #endif
242    
243          pEnc->sStat.fMvPrevSigma = -1;          pEnc->sStat.fMvPrevSigma = -1;
244    
245          /* Fill rate control parameters */          /* Fill rate control parameters */
# Line 336  Line 344 
344          pEnc->global = pParam->global;          pEnc->global = pParam->global;
345          pEnc->mbParam.max_bframes = pParam->max_bframes;          pEnc->mbParam.max_bframes = pParam->max_bframes;
346          pEnc->bquant_ratio = pParam->bquant_ratio;          pEnc->bquant_ratio = pParam->bquant_ratio;
347            pEnc->frame_drop_ratio = pParam->frame_drop_ratio;
348          pEnc->bframes = NULL;          pEnc->bframes = NULL;
349    
350          if (pEnc->mbParam.max_bframes > 0) {          if (pEnc->mbParam.max_bframes > 0) {
# Line 413  Line 422 
422          pEnc->mbParam.m_seconds = 0;          pEnc->mbParam.m_seconds = 0;
423          pEnc->mbParam.m_ticks = 0;          pEnc->mbParam.m_ticks = 0;
424          pEnc->m_framenum = 0;          pEnc->m_framenum = 0;
425            pEnc->last_pframe = 1;
426  #endif  #endif
427    
428          pParam->handle = (void *) pEnc;          pParam->handle = (void *) pEnc;
# Line 625  Line 635 
635  {  {
636          if (pEnc->queue_size >= pEnc->mbParam.max_bframes)          if (pEnc->queue_size >= pEnc->mbParam.max_bframes)
637          {          {
638                  DPRINTF("FATAL: QUEUE FULL");                  DPRINTF(DPRINTF_DEBUG,"FATAL: QUEUE FULL");
639                  return;                  return;
640          }          }
641    
642          DPRINTF("*** QUEUE bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",          DPRINTF(DPRINTF_DEBUG,"*** QUEUE bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
643                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
644                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
645    
# Line 697  Line 707 
707                           * frame as a pframe                           * frame as a pframe
708                           */                           */
709    
710                          DPRINTF("*** BFRAME (final frame) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                          DPRINTF(DPRINTF_DEBUG,"*** BFRAME (final frame) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
711                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
712                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
713    
# Line 716  Line 726 
726                  }                  }
727    
728    
729                  DPRINTF("*** BFRAME (flush) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** BFRAME (flush) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
730                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
731                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
732    
# Line 738  Line 748 
748    
749                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {
750    
751                          DPRINTF("*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                          DPRINTF(DPRINTF_DEBUG,"*** EMPTY bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
752                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
753                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
754    
   
755                          BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0);                          BitstreamWriteVopHeader(&bs, &pEnc->mbParam, pEnc->current, 0);
756                          BitstreamPad(&bs);                          BitstreamPad(&bs);
757                          BitstreamPutBits(&bs, 0x7f, 8);                          BitstreamPutBits(&bs, 0x7f, 8);
# Line 809  Line 818 
818    
819          } else if (BitstreamPos(&bs) == 0) {          } else if (BitstreamPos(&bs) == 0) {
820    
821                  DPRINTF("*** SKIP bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** SKIP bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
822                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
823                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
824    
   
825                  pFrame->intra = 0;                  pFrame->intra = 0;
826    
827                  BitstreamPutBits(&bs, 0x7f, 8);                  BitstreamPutBits(&bs, 0x7f, 8);
# Line 916  Line 924 
924           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */           * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
925    
926    
927          if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop != -1 ||          if (pEnc->iFrameNum == 0 || pFrame->intra == 1 || pEnc->bframenum_dx50bvop >= 0 ||
928                  (pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 &&                  (pFrame->intra < 0 && pEnc->iMaxKeyInterval > 0 &&
929                   pEnc->iFrameNum >= pEnc->iMaxKeyInterval)                   pEnc->iFrameNum >= pEnc->iMaxKeyInterval)
930                  || image_mad(&pEnc->reference->image, &pEnc->current->image,                  || image_mad(&pEnc->reference->image, &pEnc->current->image,
# Line 926  Line 934 
934                   * This will be coded as an Intra Frame                   * This will be coded as an Intra Frame
935                   */                   */
936    
937                  DPRINTF("*** IFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** IFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
938                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
939                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
940    
# Line 950  Line 958 
958                          pFrame->intra = 0;                          pFrame->intra = 0;
959    
960                  } else {                  } else {
961                          pEnc->bframenum_dx50bvop = -1;  
962                          FrameCodeI(pEnc, &bs, &bits);                          FrameCodeI(pEnc, &bs, &bits);
963                          pFrame->intra = 1;                          pFrame->intra = 1;
964    
965                            pEnc->bframenum_dx50bvop = -1;
966                  }                  }
967    
968                  pEnc->flush_bframes = 1;                  pEnc->flush_bframes = 1;
969    
970                  if ((pEnc->global & XVID_GLOBAL_PACKED)) {                  if ((pEnc->global & XVID_GLOBAL_PACKED) && pEnc->bframenum_tail > 0) {
971                          BitstreamPad(&bs);                          BitstreamPad(&bs);
972                          input_valid = 0;                          input_valid = 0;
973                          goto ipvop_loop;                          goto ipvop_loop;
# Line 972  Line 982 
982                   * This will be coded as a Predicted Frame                   * This will be coded as a Predicted Frame
983                   */                   */
984    
985                  DPRINTF("*** PFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** PFRAME bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
986                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
987                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
988    
# Line 995  Line 1005 
1005                   * This will be coded as a Bidirectional Frame                   * This will be coded as a Bidirectional Frame
1006                   */                   */
1007    
1008                  DPRINTF("*** BFRAME (store) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",                  DPRINTF(DPRINTF_DEBUG,"*** BFRAME (store) bf: head=%i tail=%i   queue: head=%i tail=%i size=%i",
1009                                  pEnc->bframenum_head, pEnc->bframenum_tail,                                  pEnc->bframenum_head, pEnc->bframenum_tail,
1010                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);                                  pEnc->queue_head, pEnc->queue_tail, pEnc->queue_size);
1011    
# Line 1312  Line 1322 
1322                                  &pEnc->current->mbs[x + y * pEnc->mbParam.mb_width];                                  &pEnc->current->mbs[x + y * pEnc->mbParam.mb_width];
1323                          MVBLOCKHINT *bhint =                          MVBLOCKHINT *bhint =
1324                                  &hint->mvhint.block[x + y * pEnc->mbParam.mb_width];                                  &hint->mvhint.block[x + y * pEnc->mbParam.mb_width];
1325                          VECTOR pred[4];                          VECTOR pred;
1326                          VECTOR tmp;                          VECTOR tmp;
                         int32_t dummy[4];  
1327                          int vec;                          int vec;
1328    
1329                          pMB->mode =                          pMB->mode =
# Line 1334  Line 1343 
1343                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                  tmp.x -= (tmp.x >= high) ? high * 2 : 0;
1344                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                  tmp.y -= (tmp.y >= high) ? high * 2 : 0;
1345    
1346                                  get_pmvdata(pEnc->current->mbs, x, y, pEnc->mbParam.mb_width,                                  pred = get_pmv2(pEnc->current->mbs,pEnc->mbParam.mb_width,0,x,y,0);
                                                         0, pred, dummy);  
1347    
1348                                  for (vec = 0; vec < 4; ++vec) {                                  for (vec = 0; vec < 4; ++vec) {
1349                                          pMB->mvs[vec].x = tmp.x;                                          pMB->mvs[vec].x = tmp.x;
1350                                          pMB->mvs[vec].y = tmp.y;                                          pMB->mvs[vec].y = tmp.y;
1351                                          pMB->pmvs[vec].x = pMB->mvs[0].x - pred[0].x;                                          pMB->pmvs[vec].x = pMB->mvs[0].x - pred.x;
1352                                          pMB->pmvs[vec].y = pMB->mvs[0].y - pred[0].y;                                          pMB->pmvs[vec].y = pMB->mvs[0].y - pred.y;
1353                                  }                                  }
1354                          } else if (pMB->mode == MODE_INTER4V) {                          } else if (pMB->mode == MODE_INTER4V) {
1355                                  for (vec = 0; vec < 4; ++vec) {                                  for (vec = 0; vec < 4; ++vec) {
# Line 1354  Line 1362 
1362                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;                                          tmp.x -= (tmp.x >= high) ? high * 2 : 0;
1363                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;                                          tmp.y -= (tmp.y >= high) ? high * 2 : 0;
1364    
1365                                          get_pmvdata(pEnc->current->mbs, x, y,                                          pred = get_pmv2(pEnc->current->mbs,pEnc->mbParam.mb_width,0,x,y,vec);
                                                                 pEnc->mbParam.mb_width, vec, pred, dummy);  
1366    
1367                                          pMB->mvs[vec].x = tmp.x;                                          pMB->mvs[vec].x = tmp.x;
1368                                          pMB->mvs[vec].y = tmp.y;                                          pMB->mvs[vec].y = tmp.y;
1369                                          pMB->pmvs[vec].x = pMB->mvs[vec].x - pred[0].x;                                          pMB->pmvs[vec].x = pMB->mvs[vec].x - pred.x;
1370                                          pMB->pmvs[vec].y = pMB->mvs[vec].y - pred[0].y;                                          pMB->pmvs[vec].y = pMB->mvs[vec].y - pred.y;
1371                                  }                                  }
1372                          } else                          // intra / stuffing / not_coded                          } else                          // intra / stuffing / not_coded
1373                          {                          {
# Line 1591  Line 1598 
1598          if (pEnc->current->global_flags & XVID_HINTEDME_SET) {          if (pEnc->current->global_flags & XVID_HINTEDME_SET) {
1599                  HintedMESet(pEnc, &bIntra);                  HintedMESet(pEnc, &bIntra);
1600          } else {          } else {
1601    
1602    #ifdef _SMP
1603            if (pEnc->mbParam.num_threads > 1)
1604                    bIntra =
1605                            SMP_MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,
1606                                                     &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,
1607                                                     iLimit);
1608            else
1609    #endif
1610                  bIntra =                  bIntra =
1611                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,                          MotionEstimation(&pEnc->mbParam, pEnc->current, pEnc->reference,
1612                                                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,                                                           &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,
1613                                                           iLimit);                                                           iLimit);
1614    
1615          }          }
1616          stop_motion_timer();          stop_motion_timer();
1617    
# Line 1706  Line 1723 
1723    
1724          pEnc->sStat.fMvPrevSigma = fSigma;          pEnc->sStat.fMvPrevSigma = fSigma;
1725    
1726    #ifdef BFRAMES
1727            /* frame drop code */
1728            // DPRINTF(DPRINTF_DEBUG, "kmu %i %i %i", pEnc->sStat.kblks, pEnc->sStat.mblks, pEnc->sStat.ublks);
1729            if (pEnc->sStat.kblks + pEnc->sStat.mblks <=
1730                    (pEnc->frame_drop_ratio * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height) / 100)
1731            {
1732                    pEnc->sStat.kblks = pEnc->sStat.mblks = 0;
1733                    pEnc->sStat.ublks = pEnc->mbParam.mb_width * pEnc->mbParam.mb_height;
1734    
1735                    BitstreamReset(bs);
1736                    BitstreamWriteVopHeader(bs, &pEnc->mbParam, pEnc->current, 0);
1737    
1738                    // copy reference frame details into the current frame
1739                    pEnc->current->quant = pEnc->reference->quant;
1740                    pEnc->current->motion_flags = pEnc->reference->motion_flags;
1741                    pEnc->current->rounding_type = pEnc->reference->rounding_type;
1742                    pEnc->current->fcode = pEnc->reference->fcode;
1743                    pEnc->current->bcode = pEnc->reference->bcode;
1744                    image_copy(&pEnc->current->image, &pEnc->reference->image, pEnc->mbParam.edged_width, pEnc->mbParam.height);
1745                    memcpy(pEnc->current->mbs, pEnc->reference->mbs, sizeof(MACROBLOCK) * pEnc->mbParam.mb_width * pEnc->mbParam.mb_height);
1746    
1747            }
1748    #endif
1749    
1750          *pBits = BitstreamPos(bs) - *pBits;          *pBits = BitstreamPos(bs) - *pBits;
1751    
1752    #ifdef BFRAMES
1753            pEnc->time_pp = ((int32_t)pEnc->mbParam.fbase - (int32_t)pEnc->last_pframe + (int32_t)pEnc->mbParam.m_ticks) % (int32_t)pEnc->mbParam.fbase;
1754    
1755            pEnc->last_pframe = pEnc->mbParam.m_ticks;
1756    #endif
1757          return 0;                                       // inter          return 0;                                       // inter
1758  }  }
1759    
# Line 1728  Line 1774 
1774          IMAGE *f_ref = &pEnc->reference->image;          IMAGE *f_ref = &pEnc->reference->image;
1775          IMAGE *b_ref = &pEnc->current->image;          IMAGE *b_ref = &pEnc->current->image;
1776    
1777    #ifdef BFRAMES_DEC_DEBUG
1778            FILE *fp;
1779            static char first=0;
1780    #define BFRAME_DEBUG    if (!first && fp){ \
1781                    fprintf(fp,"Y=%3d   X=%3d   MB=%2d   CBP=%02X\n",y,x,mb->mode,mb->cbp); \
1782            }
1783    
1784            if (!first){
1785                    fp=fopen("C:\\XVIDDBGE.TXT","w");
1786            }
1787    #endif
1788    
1789          // forward          // forward
1790          image_setedges(f_ref, pEnc->mbParam.edged_width,          image_setedges(f_ref, pEnc->mbParam.edged_width,
1791                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,
# Line 1751  Line 1809 
1809          stop_inter_timer();          stop_inter_timer();
1810    
1811          start_timer();          start_timer();
1812          MotionEstimationBVOP(&pEnc->mbParam, frame, pEnc->reference->mbs, f_ref,          MotionEstimationBVOP(&pEnc->mbParam, frame,
1813              ((int32_t)pEnc->mbParam.fbase + (int32_t)pEnc->mbParam.m_ticks + 1 - (int32_t)pEnc->last_pframe) % pEnc->mbParam.fbase,
1814                                                    pEnc->time_pp,
1815                                                    pEnc->reference->mbs, f_ref,
1816                                                   &pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv,                                                   &pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv,
1817                                                   pEnc->current->mbs, b_ref, &pEnc->vInterH,                                                   pEnc->current->mbs, b_ref, &pEnc->vInterH,
1818                                                   &pEnc->vInterV, &pEnc->vInterHV);                                                   &pEnc->vInterV, &pEnc->vInterHV);
# Line 1794  Line 1855 
1855                          if (mb->mode == MODE_NOT_CODED) {                          if (mb->mode == MODE_NOT_CODED) {
1856                                  mb->mvs[0].x = 0;                                  mb->mvs[0].x = 0;
1857                                  mb->mvs[0].y = 0;                                  mb->mvs[0].y = 0;
1858    
1859                                    mb->cbp = 0;
1860    #ifdef BFRAMES_DEC_DEBUG
1861            BFRAME_DEBUG
1862    #endif
1863                                  continue;                                  continue;
1864                          }                          }
1865    
# Line 1812  Line 1878 
1878    
1879                          if ((mb->mode == MODE_INTERPOLATE || mb->mode == MODE_DIRECT)                          if ((mb->mode == MODE_INTERPOLATE || mb->mode == MODE_DIRECT)
1880                                  && mb->cbp == 0 && mb->mvs[0].x == 0 && mb->mvs[0].y == 0) {                                  && mb->cbp == 0 && mb->mvs[0].x == 0 && mb->mvs[0].y == 0) {
1881                                  mb->mode = 5;   // skipped                                  mb->mode = MODE_DIRECT_NONE_MV; // skipped
1882                          }                          }
1883    
1884                          if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) {                          if (mb->mode == MODE_INTERPOLATE || mb->mode == MODE_FORWARD) {
# Line 1830  Line 1896 
1896                          }                          }
1897  //                      DPRINTF("%05i : [%i %i] M=%i CBP=%i MVS=%i,%i forward=%i,%i", pEnc->m_framenum, x, y, mb->mode, mb->cbp, mb->mvs[0].x, mb->mvs[0].y, forward.x, forward.y);  //                      DPRINTF("%05i : [%i %i] M=%i CBP=%i MVS=%i,%i forward=%i,%i", pEnc->m_framenum, x, y, mb->mode, mb->cbp, mb->mvs[0].x, mb->mvs[0].y, forward.x, forward.y);
1898    
1899    #ifdef BFRAMES_DEC_DEBUG
1900            BFRAME_DEBUG
1901    #endif
1902                          start_timer();                          start_timer();
1903                          MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs,                          MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs,
1904                                                   &pEnc->sStat);                                                   &pEnc->sStat);
# Line 1842  Line 1911 
1911          // TODO: dynamic fcode/bcode ???          // TODO: dynamic fcode/bcode ???
1912    
1913          *pBits = BitstreamPos(bs) - *pBits;          *pBits = BitstreamPos(bs) - *pBits;
1914    
1915    #ifdef BFRAMES_DEC_DEBUG
1916            if (!first){
1917                    first=1;
1918                    if (fp)
1919                            fclose(fp);
1920            }
1921    #endif
1922  }  }
1923  #endif  #endif

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.60

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4