Re: Dynamic Output Quality Patch, Take 2
Of course, immediately after I sent that, I noticed that decode_video() was called in two places, and so that patch will not initialize vdecode_time correctly. A new mplayer.c diff (still from the original 7/31 snapshot) is attached. 228c228,229 < int divx_quality=0; ---
int divx_quality=-1; int output_quality; 387a389,390 extern int get_video_quality_max(sh_video_t *sh_video); extern void set_video_quality(sh_video_t *sh_video,int quality); 878a882,887 /*Set the initial video quality on codecs that support it.*/ output_quality=get_video_quality_max(sh_video); if(divx_quality<0||divx_quality>output_quality)divx_quality=output_quality; else output_quality=divx_quality; set_video_quality(sh_video,output_quality);
997c1006 < //float frame_correction=0; // average of A-V timestamp differences ---
float frame_correction=0; // average of A-V timestamp differences 1007a1017,1019 double cvideo_base_vtime; double cvideo_base_vframe; double vdecode_time; 1189a1202,1203 cvideo_base_vframe=sh_video->timer; cvideo_base_vtime=video_time_usage; 1246a1261 vdecode_time=video_time_usage; 1247a1263 vdecode_time-=video_time_usage; 1289c1305 <
1367a1384
frame_correction=0; 1404c1421 < float x=(a_pts-delay-audio_delay)-v_pts;
float x=frame_correction=(a_pts-delay-audio_delay)-v_pts;
1438a1456,1474
/*Output quality adjustments:*/ /*If we took a long time decoding this frame, downgrade the quality.*/ if(output_quality>0&& (video_time_usage-cvideo_base_vtime)*sh_video->timer>= (0.95*sh_video->timer-(vout_time_usage+audio_time_usage))* (sh_video->timer-cvideo_base_vframe-frame_correction)){ output_quality>>=1; /*printf("Downgrading quality to %i.\n",output_quality);*/ set_video_quality(sh_video,output_quality);} /*If we had plenty of extra time, upgrade the quality.*/ if(output_quality<divx_quality&& vdecode_time<0.5*frame_time&& (video_time_usage-cvideo_base_vtime)*sh_video->timer< (0.67*sh_video->timer-(vout_time_usage+audio_time_usage))* (sh_video->timer-cvideo_base_vframe-frame_correction)){ output_quality++; /*printf("Upgrading quality to %i.\n",output_quality);*/ set_video_quality(sh_video,output_quality);}
Hi,
Of course, immediately after I sent that, I noticed that decode_video() was called in two places, and so that patch will not initialize vdecode_time correctly. A new mplayer.c diff (still from the original 7/31 snapshot) is attached.
228c228,229 < int divx_quality=0; ---
int divx_quality=-1; int output_quality;
please send applyable patch (diff -Naur or so) btw i don't like this patch. you shouldn't touch divx_quality, use new option -autopp or -autoq, and new variable, for example auto_quality. leave -pp for compatibility and manual setting. (including pp values 0-63 and so) other problem is that you use DS_SetValue_DivX(), but it won't work without calling DS_SetAttr_DivX() first. but it's enough to do once (per change), because it will write only to the registry. i think you had it already set in your registry file, so it worked for you without this call. A'rpi / Astral & ESP-team -- mailto:arpi@thot.banki.hu http://esp-team.scene.hu _______________________________________________ Mplayer-dev-eng mailing list Mplayer-dev-eng@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/mplayer-dev-eng
participants (2)
-
Arpi -
Timothy B. Terriberry