MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / compressYUV

Method compressYUV

common/Frame.cpp:434–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432
433
434void CompressedFrame::compressYUV(Frame &f)
435{
436 int tjflags = 0;
437
438 if(f.hdr.subsamp != 4) throw(Error("YUV encoder", "Invalid argument"));
439 if(f.pf->bpc != 8)
440 throw(Error("YUV encoder", "YUV encoding requires 8 bits per component"));
441
442 init(f.hdr, 0);
443 if(f.flags & FRAME_BOTTOMUP) tjflags |= TJ_BOTTOMUP;
444 TRY_TJ(tjEncodeYUV2(tjhnd, f.bits, f.hdr.width, f.pitch, f.hdr.height,
445 tjpf[f.pf->id], bits, TJSUBSAMP(f.hdr.subsamp), tjflags));
446 hdr.size = (unsigned int)tjBufSizeYUV(f.hdr.width, f.hdr.height,
447 TJSUBSAMP(f.hdr.subsamp));
448}
449
450
451void CompressedFrame::compressJPEG(Frame &f)

Callers

nothing calls this directly

Calls 2

ErrorClass · 0.50
initFunction · 0.50

Tested by

no test coverage detected