[svn] / branches / dev-api-4 / xvidcore / src / encoder.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/encoder.c

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

revision 1189, Mon Oct 27 00:50:05 2003 UTC revision 1200, Wed Nov 5 16:15:47 2003 UTC
# Line 21  Line 21 
21   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
22   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23   *   *
24   * $Id: encoder.c,v 1.95.2.46 2003-10-27 00:50:05 edgomez Exp $   * $Id: encoder.c,v 1.95.2.47 2003-11-05 16:15:47 edgomez Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 1410  Line 1410 
1410          pEnc->fMvPrevSigma = -1;          pEnc->fMvPrevSigma = -1;
1411          pEnc->mbParam.m_fcode = 2;          pEnc->mbParam.m_fcode = 2;
1412    
1413            pEnc->current->is_edged = 0; /* not edged */
1414            pEnc->current->is_interpolated = -1; /* not interpolated (fake rounding -1) */
1415    
1416          return 1;                                       /* intra */          return 1;                                       /* intra */
1417  }  }
1418    
# Line 1452  Line 1455 
1455          }          }
1456    
1457    
1458            if (!reference->is_edged) {
1459          start_timer();          start_timer();
1460          image_setedges(pRef, pParam->edged_width, pParam->edged_height,          image_setedges(pRef, pParam->edged_width, pParam->edged_height,
1461                                     pParam->width, pParam->height);                                     pParam->width, pParam->height);
1462          stop_edges_timer();          stop_edges_timer();
1463                    reference->is_edged = 1;
1464            }
1465    
1466          pParam->m_rounding_type = 1 - pParam->m_rounding_type;          pParam->m_rounding_type = 1 - pParam->m_rounding_type;
1467          current->rounding_type = pParam->m_rounding_type;          current->rounding_type = pParam->m_rounding_type;
# Line 1467  Line 1473 
1473                  iLimit = mb_width * mb_height + 1;                  iLimit = mb_width * mb_height + 1;
1474    
1475          if ((current->vop_flags & XVID_VOP_HALFPEL)) {          if ((current->vop_flags & XVID_VOP_HALFPEL)) {
1476                    if (reference->is_interpolated != current->rounding_type) {
1477                  start_timer();                  start_timer();
1478                  image_interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV,                  image_interpolate(pRef, &pEnc->vInterH, &pEnc->vInterV,
1479                                                    &pEnc->vInterHV, pParam->edged_width,                                                    &pEnc->vInterHV, pParam->edged_width,
# Line 1474  Line 1481 
1481                                                    (pParam->vol_flags & XVID_VOL_QUARTERPEL),                                                    (pParam->vol_flags & XVID_VOL_QUARTERPEL),
1482                                                    current->rounding_type);                                                    current->rounding_type);
1483                  stop_inter_timer();                  stop_inter_timer();
1484                            reference->is_interpolated = current->rounding_type;
1485                    }
1486          }          }
1487    
1488          current->coding_type = P_VOP;          current->coding_type = P_VOP;
# Line 1781  Line 1790 
1790                  memcpy(current->mbs, reference->mbs, sizeof(MACROBLOCK) * mb_width * mb_height);                  memcpy(current->mbs, reference->mbs, sizeof(MACROBLOCK) * mb_width * mb_height);
1791          }          }
1792    
1793            pEnc->current->is_edged = 0; /* not edged */
1794            pEnc->current->is_interpolated = -1; /* not interpolated (fake rounding -1) */
1795    
1796            /* what was this frame's interpolated reference will become
1797                    forward (past) reference in b-frame coding */
1798    
1799            image_swap(&pEnc->vInterH, &pEnc->f_refh);
1800            image_swap(&pEnc->vInterV, &pEnc->f_refv);
1801            image_swap(&pEnc->vInterHV, &pEnc->f_refhv);
1802    
1803    
1804          /* XXX: debug          /* XXX: debug
1805          {          {
1806                  char s[100];                  char s[100];
# Line 1832  Line 1852 
1852  #endif  #endif
1853    
1854          /* forward  */          /* forward  */
1855            if (!pEnc->reference->is_edged) {
1856          image_setedges(f_ref, pEnc->mbParam.edged_width,          image_setedges(f_ref, pEnc->mbParam.edged_width,
1857                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,
1858                                     pEnc->mbParam.height);                                     pEnc->mbParam.height);
1859                    pEnc->current->is_edged = 1;
1860            }
1861    
1862            if (pEnc->reference->is_interpolated != 0) {
1863          start_timer();          start_timer();
1864          image_interpolate(f_ref, &pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv,          image_interpolate(f_ref, &pEnc->f_refh, &pEnc->f_refv, &pEnc->f_refhv,
1865                                            pEnc->mbParam.edged_width, pEnc->mbParam.edged_height,                                            pEnc->mbParam.edged_width, pEnc->mbParam.edged_height,
1866                                            (pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0);                                            (pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0);
1867          stop_inter_timer();          stop_inter_timer();
1868                    pEnc->reference->is_interpolated = 0;
1869            }
1870    
1871          /* backward */          /* backward */
1872            if (!pEnc->current->is_edged) {
1873          image_setedges(b_ref, pEnc->mbParam.edged_width,          image_setedges(b_ref, pEnc->mbParam.edged_width,
1874                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,                                     pEnc->mbParam.edged_height, pEnc->mbParam.width,
1875                                     pEnc->mbParam.height);                                     pEnc->mbParam.height);
1876                    pEnc->current->is_edged = 1;
1877            }
1878    
1879            if (pEnc->current->is_interpolated != 0) {
1880          start_timer();          start_timer();
1881          image_interpolate(b_ref, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,          image_interpolate(b_ref, &pEnc->vInterH, &pEnc->vInterV, &pEnc->vInterHV,
1882                                            pEnc->mbParam.edged_width, pEnc->mbParam.edged_height,                                            pEnc->mbParam.edged_width, pEnc->mbParam.edged_height,
1883                                            (pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0);                                            (pEnc->mbParam.vol_flags & XVID_VOL_QUARTERPEL), 0);
1884          stop_inter_timer();          stop_inter_timer();
1885                    pEnc->current->is_interpolated = 0;
1886            }
1887    
1888          start_timer();          start_timer();
1889          MotionEstimationBVOP(&pEnc->mbParam, frame,          MotionEstimationBVOP(&pEnc->mbParam, frame,

Legend:
Removed from v.1189  
changed lines
  Added in v.1200

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