[xiph-commits] r16044 - branches/theora-thusnelda/lib/enc
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Tue May 26 19:05:43 PDT 2009
Author: tterribe
Date: 2009-05-26 19:05:43 -0700 (Tue, 26 May 2009)
New Revision: 16044
Modified:
branches/theora-thusnelda/lib/enc/codec_internal.h
branches/theora-thusnelda/lib/enc/dct_encode.c
branches/theora-thusnelda/lib/enc/encoder_toplevel.c
branches/theora-thusnelda/lib/enc/mode.c
Log:
Don't apply R-D optimization to the first two AC coefficients of INTRA blocks,
as it introduces large amounts of blocking artifacts.
Also bump up the keyframe bit ratio.
Modified: branches/theora-thusnelda/lib/enc/codec_internal.h
===================================================================
--- branches/theora-thusnelda/lib/enc/codec_internal.h 2009-05-27 01:18:06 UTC (rev 16043)
+++ branches/theora-thusnelda/lib/enc/codec_internal.h 2009-05-27 02:05:43 UTC (rev 16044)
@@ -396,7 +396,7 @@
const ogg_int16_t *dequant,
const ogg_int16_t *origdct,
const int chroma,
- token_checkpoint_t **stack);
+ token_checkpoint_t **stack,int _acmin);
extern void dct_tokenize_finish (CP_INSTANCE *cpi);
extern void dct_tokenize_mark_ac_chroma (CP_INSTANCE *cpi);
Modified: branches/theora-thusnelda/lib/enc/dct_encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_encode.c 2009-05-27 01:18:06 UTC (rev 16043)
+++ branches/theora-thusnelda/lib/enc/dct_encode.c 2009-05-27 02:05:43 UTC (rev 16044)
@@ -470,7 +470,7 @@
int dct_tokenize_AC(CP_INSTANCE *cpi, const int fi,
ogg_int16_t *dct, const ogg_int16_t *dequant,
const ogg_int16_t *origdct, const int chroma,
- token_checkpoint_t **stack){
+ token_checkpoint_t **stack,int _acmin){
int coeff = 1; /* skip DC for now */
int i = coeff;
int retcost = 0;
@@ -487,6 +487,7 @@
while((j < BLOCK_SIZE) && !dct[j] ) j++;
+ if(i>=_acmin){
if(j==BLOCK_SIZE){
cost = tokenize_eobcost(cpi,chroma,coeff);
if(i+1<BLOCK_SIZE)
@@ -518,6 +519,10 @@
i=j;
continue;
}
+ }
+ else{
+ bestcost = tokenize_dctcost(cpi,chroma,coeff,i,d);
+ }
retcost+=bestcost;
Modified: branches/theora-thusnelda/lib/enc/encoder_toplevel.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encoder_toplevel.c 2009-05-27 01:18:06 UTC (rev 16043)
+++ branches/theora-thusnelda/lib/enc/encoder_toplevel.c 2009-05-27 02:05:43 UTC (rev 16044)
@@ -179,7 +179,7 @@
minimum quality permitted.*/
if(rate_total<=0)log_qtarget=OC_QUANT_MAX_LOG;
else{
- static const unsigned char KEY_RATIO[2]={29,32};
+ static const unsigned char KEY_RATIO[2]={32,17};
ogg_int64_t log_scale0;
ogg_int64_t log_scale1;
ogg_int64_t prevr;
Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c 2009-05-27 01:18:06 UTC (rev 16043)
+++ branches/theora-thusnelda/lib/enc/mode.c 2009-05-27 02:05:43 UTC (rev 16044)
@@ -639,7 +639,7 @@
cpi->frag_dc[fi] = data[0];
/* tokenize */
- cost = dct_tokenize_AC(cpi, fi, data, dequant, buffer, fi>=cpi->frag_n[0], stack);
+ cost = dct_tokenize_AC(cpi, fi, data, dequant, buffer, fi>=cpi->frag_n[0], stack,mode==CODE_INTRA?3:0);
/*Reconstruct.*/
oc_enc_dequant_idct8x8(cpi,buffer,data,
More information about the commits
mailing list