Creates a Tensor by decoding an HEVC frame chunk. You must provide the output shape of the decoded data (`shape`), the HEVC context (`vstate`), and, if required by the chunk, the reference frames (`ref_frames`).
(self, frame_pos:Variable, shape:tuple[int,...], state:Tensor, ref_frames:list[Tensor]|None=None)
| 1317 | # ***** encoding/decoding ops ***** |
| 1318 | |
| 1319 | def decode_hevc_frame(self, frame_pos:Variable, shape:tuple[int,...], state:Tensor, ref_frames:list[Tensor]|None=None) -> Tensor: |
| 1320 | """ |
| 1321 | Creates a Tensor by decoding an HEVC frame chunk. |
| 1322 | |
| 1323 | You must provide the output shape of the decoded data (`shape`), the HEVC context (`vstate`), and, if required by the chunk, |
| 1324 | the reference frames (`ref_frames`). |
| 1325 | """ |
| 1326 | ref_frames = [x.contiguous() for x in ref_frames or []] |
| 1327 | assert frame_pos.op is Ops.BIND, "frame_pos must be a bound Variable" |
| 1328 | srcs = (out:=Tensor.empty(*shape, device=self.device, dtype=self.dtype), self.contiguous(), state.contiguous(), *ref_frames) |
| 1329 | fn = UOp(Ops.CUSTOM_FUNCTION, dtypes.void, src=(frame_pos.src[0], *[UOp.const(dtypes.int, s) for s in shape]), arg="encdec") |
| 1330 | return Tensor(out.uop.after(fn.call(*[s.uop for s in srcs], frame_pos))) |
| 1331 | |
| 1332 | # ***** functional nn ops ***** |
| 1333 |
no test coverage detected