1
/***************************************************************************
2
ADM_vidFlipV.cpp - description
5
copyright : (C) 2002 by mean
6
email : fixounet@free.fr
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
21
#include <ADM_assert.h>
31
#include "ADM_toolkit/toolkit.hxx"
32
#include "ADM_editor/ADM_edit.hxx"
33
#include "ADM_video/ADM_genvideo.hxx"
34
#include "ADM_vidFlipV.h"
35
#include "ADM_filter/video_filters.h"
38
static FILTER_PARAM flipParam={0,{""}};
41
SCRIPT_CREATE(flipv_script,ADMVideoFlipV,flipParam);
42
BUILD_CREATE(flipv_create,ADMVideoFlipV);
45
char *ADMVideoFlipV::printConf( void )
49
sprintf((char *)buf," V-Flip");
53
ADMVideoFlipV::ADMVideoFlipV( AVDMGenericVideoStream *in,CONFcouple *setup)
57
memcpy(&_info,_in->getInfo(),sizeof(_info));
59
_uncompressed=new ADMImage(_in->getInfo()->width,_in->getInfo()->height);
60
ADM_assert(_uncompressed);
62
ADMVideoFlipV::~ADMVideoFlipV()
68
uint8_t ADMVideoFlipV::getFrameNumberNoAlloc(uint32_t frame,
74
if(frame>= _info.nb_frames) return 0;
75
// read uncompressed frame
76
if(!_in->getFrameNumberNoAlloc(frame, len,_uncompressed,flags)) return 0;
79
uint32_t stride=_info.width;
80
uint32_t h=_info.height;
88
in=YPLANE(_uncompressed);
89
out=YPLANE(data)+(h-1)*stride;
91
for(uint32_t y=h;y>0;y--)
93
memcpy(out,in,stride);
99
in=UPLANE(_uncompressed);
100
out=UPLANE(data)+qpage-stride;
102
for(uint32_t y=h>>1;y>0;y--)
104
memcpy(out,in,stride);
108
in=VPLANE(_uncompressed);
109
out=VPLANE(data)+qpage-stride;
113
for(uint32_t y=h>>1;y>0;y--)
115
memcpy(out,in,stride);
119
data->copyInfo(_uncompressed);