28 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
29 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
30 |
* |
* |
31 |
|
* $Id: encoder.c,v 1.81 2002-09-05 21:02:19 chl Exp $ |
32 |
|
* |
33 |
****************************************************************************/ |
****************************************************************************/ |
34 |
|
|
35 |
#include <stdlib.h> |
#include <stdlib.h> |
102 |
* Encoder creation |
* Encoder creation |
103 |
* |
* |
104 |
* This function creates an Encoder instance, it allocates all necessary |
* This function creates an Encoder instance, it allocates all necessary |
105 |
* image buffers (reference, current and bframes) and initialize the internal |
* image buffers (reference, current) and initialize the internal xvid |
106 |
* xvid encoder paremeters according to the XVID_ENC_PARAM input parameter. |
* encoder paremeters according to the XVID_ENC_PARAM input parameter. |
107 |
* |
* |
108 |
* The code seems to be very long but is very basic, mainly memory allocation |
* The code seems to be very long but is very basic, mainly memory allocation |
109 |
* and cleaning code. |
* and cleaning code. |
1000 |
CodeIntraMB(pEnc, pMB); |
CodeIntraMB(pEnc, pMB); |
1001 |
MBTransQuantIntra(&pEnc->mbParam, pEnc->current, pMB, x, y, |
MBTransQuantIntra(&pEnc->mbParam, pEnc->current, pMB, x, y, |
1002 |
dct_codes, qcoeff); |
dct_codes, qcoeff); |
|
} |
|
1003 |
|
|
1004 |
start_timer(); |
start_timer(); |
1005 |
MBPrediction(pEnc->current, x, y, pEnc->mbParam.mb_width, qcoeff); |
MBPrediction(pEnc->current, x, y, pEnc->mbParam.mb_width, qcoeff); |
1006 |
stop_prediction_timer(); |
stop_prediction_timer(); |
1007 |
|
} |
1008 |
|
|
1009 |
if (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q) { |
if (pMB->mode == MODE_INTRA || pMB->mode == MODE_INTRA_Q) { |
1010 |
pEnc->sStat.kblks++; |
pEnc->sStat.kblks++; |