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

View of /xvidcore/src/plugins/plugin_psnr.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.2 - (download) (annotate)
Sat Mar 15 16:04:38 2003 UTC (16 years, 7 months ago) by suxen_drol
Branch: dev-api-4
Changes since 1.1.2.1: +4 -29 lines
plugin/stats returns sse (integer)
#include "../xvid.h"
#include "../image/image.h"


int xvid_plugin_psnr(void * handle, int opt, void * param1, void * param2)
{
    switch(opt)
    {
    case XVID_PLG_INFO :
        {
        xvid_plg_info_t * info = (xvid_plg_info_t*)param1;
        info->flags = XVID_REQPSNR;
        return 0;
        }

    case XVID_PLG_CREATE :
    case XVID_PLG_DESTROY :
    case XVID_PLG_BEFORE :
       return 0;

    case XVID_PLG_AFTER :
       {
       xvid_plg_data_t * data = (xvid_plg_data_t*)param1;

       printf("y_psnr=%2.2f u_psnr=%2.2f v_psnr=%2.2f\n", 
           sse_to_PSNR(data->sse_y, data->width*data->height),
           sse_to_PSNR(data->sse_u, data->width*data->height/4),
           sse_to_PSNR(data->sse_v, data->width*data->height/4));

       return 0;
       }
    }

    return XVID_ERR_FAIL;
}

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