| 416 | } |
| 417 | |
| 418 | void AvisynthVideoSource::OutputField(const FFMS_Frame *Frame, PVideoFrame &Dst, int Field, IScriptEnvironment *Env) { |
| 419 | const FFMS_Frame *SrcPicture = Frame; |
| 420 | if (VI.IsPlanar()) { |
| 421 | BlitField(Frame, Dst, Env, 0, VI.IsRGB() ? PLANAR_G : PLANAR_Y, Field); |
| 422 | if (HighBitDepth ? !VI.IsY() : !VI.IsY8()) { |
| 423 | BlitField(Frame, Dst, Env, 1, VI.IsRGB() ? PLANAR_B : PLANAR_U, Field); |
| 424 | BlitField(Frame, Dst, Env, 2, VI.IsRGB() ? PLANAR_R : PLANAR_V, Field); |
| 425 | } |
| 426 | if (VI.IsYUVA() || VI.IsPlanarRGBA()) |
| 427 | BlitField(Frame, Dst, Env, 3, PLANAR_A, Field); |
| 428 | } else if (VI.IsYUY2()) { |
| 429 | BlitField(Frame, Dst, Env, 0, 0, Field); |
| 430 | } else if (VI.IsRGB24() || VI.IsRGB32()) { |
| 431 | Env->BitBlt( |
| 432 | Dst->GetWritePtr() + Dst->GetPitch() * (Dst->GetHeight() - 1 - Field), -Dst->GetPitch() * 2, |
| 433 | SrcPicture->Data[0] + SrcPicture->Linesize[0] * Field, SrcPicture->Linesize[0] * 2, |
| 434 | Dst->GetRowSize(), Dst->GetHeight() / 2); |
| 435 | } else { |
| 436 | assert(false); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | PVideoFrame AvisynthVideoSource::GetFrame(int n, IScriptEnvironment *Env) { |
| 441 | n = std::min(std::max(n, 0), VI.num_frames - 1); |
nothing calls this directly
no test coverage detected