@@ -122,12 +122,13 @@ PVideoFrame __stdcall EraseLOGO_YUY2::GetFrame(int n, IScriptEnvironment *env)
122
122
env->MakeWritable (&frame);
123
123
124
124
BYTE* dst = frame->GetWritePtr ();
125
- const int dst_w = frame->GetRowSize ();
126
- const int dst_h = frame->GetHeight ();
125
+ const int dst_w = frame->GetRowSize ();
126
+ const int dst_pitch = frame->GetPitch ();
127
+ const int dst_h = frame->GetHeight ();
127
128
128
129
LOGO_PIXEL_YUY2* lgp = (LOGO_PIXEL_YUY2*)(lgh +1 );
129
130
130
- dst += lgh->x * 2 + lgh->y * dst_w ;
131
+ dst += lgh->x * 2 + lgh->y * dst_pitch ;
131
132
132
133
for (int i=0 ;i<lgh->h && i<dst_h-lgh->y ;i++){
133
134
for (int j=0 ;j<lgh->w && j<dst_w/2 -lgh->x ;j+=2 ){
@@ -154,7 +155,7 @@ PVideoFrame __stdcall EraseLOGO_YUY2::GetFrame(int n, IScriptEnvironment *env)
154
155
dst += 4 ;
155
156
lgp += 1 ;
156
157
}
157
- dst += dst_w - j * 2 ;
158
+ dst += dst_pitch - j * 2 ;
158
159
lgp += (lgh->w - j)/2 ;
159
160
}
160
161
@@ -176,11 +177,12 @@ PVideoFrame __stdcall AddLOGO_YUY2::GetFrame(int n, IScriptEnvironment *env)
176
177
177
178
BYTE* dst = frame->GetWritePtr ();
178
179
const int dst_w = frame->GetRowSize ();
180
+ const int dst_pitch = frame->GetPitch ();
179
181
const int dst_h = frame->GetHeight ();
180
182
181
183
LOGO_PIXEL_YUY2* lgp = (LOGO_PIXEL_YUY2*)(lgh +1 );
182
184
183
- dst += lgh->x * 2 + lgh->y * dst_w ;
185
+ dst += lgh->x * 2 + lgh->y * dst_pitch ;
184
186
185
187
for (int i=0 ;i<lgh->h && i<dst_h-lgh->y ;i++){
186
188
for (int j=0 ;j<lgh->w && j<dst_w/2 -lgh->x ;j+=2 ){
@@ -195,8 +197,8 @@ PVideoFrame __stdcall AddLOGO_YUY2::GetFrame(int n, IScriptEnvironment *env)
195
197
dst += 4 ;
196
198
lgp += 1 ;
197
199
}
198
- dst += dst_w - j * 2 ;
199
- lgp += (lgh->w - j)/2 ;;
200
+ dst += dst_pitch - j * 2 ;
201
+ lgp += (lgh->w - j)/2 ;
200
202
}
201
203
return frame;
202
204
}
@@ -309,14 +311,14 @@ void deLOGO_Base::AdjustLogo(int x,int y,int depth)
309
311
adjx = x % 4 ;
310
312
} else {
311
313
adjdata->x = data->x + int ((x-3 )/4 );
312
- adjx = 4 - (- x%4 );
314
+ adjx = ( 4 + ( x%4 )) % 4 ;
313
315
}
314
316
if (y>=0 ){
315
317
adjdata->y = data->y + int (y/4 );
316
318
adjy = y % 4 ;
317
319
} else {
318
320
adjdata->y = data->y + int ((y-3 )/4 );
319
- adjy = 4 - (- y%4 );
321
+ adjy = ( 4 + ( y%4 )) % 4 ;
320
322
}
321
323
322
324
adjdata->w = w = data->w + 1 ; // 1/4単位調整するため
0 commit comments