diff options
| author | Matthieu Delahaye <matthieu@multicorewareinc.com> | 2014-02-18 13:21:06 -0600 |
|---|---|---|
| committer | Jason Sams <jsams@google.com> | 2014-03-06 13:27:04 -0800 |
| commit | 60498fe9679ea25a260a503d6dfd27cbc0a0c079 (patch) | |
| tree | 486c65336e7e7be327e5ba01ae6fa617b3fea9e3 /cpp/ScriptIntrinsics.cpp | |
| parent | 010a10b8ae844caa9d091bbafa87b92504b4afab (diff) | |
Add VP9 inter-frame prediction intrinsic
Change-Id: If8985a6200fb6d34083eff711ccdf2f1b3c374e6
Diffstat (limited to 'cpp/ScriptIntrinsics.cpp')
| -rw-r--r-- | cpp/ScriptIntrinsics.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp index c5013b65..f9a1d979 100644 --- a/cpp/ScriptIntrinsics.cpp +++ b/cpp/ScriptIntrinsics.cpp @@ -66,6 +66,52 @@ void ScriptIntrinsic3DLUT::setLUT(sp<Allocation> lut) { Script::setVar(0, lut); } +sp<ScriptIntrinsicVP9InterPred> ScriptIntrinsicVP9InterPred::create(sp<RS> rs, sp<const Element> e) { + if (e->isCompatible(Element::U8(rs)) == false) { + rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic"); + return NULL; + } + return new ScriptIntrinsicVP9InterPred(rs, e); +} + +ScriptIntrinsicVP9InterPred::ScriptIntrinsicVP9InterPred(sp<RS> rs, sp<const Element> e) + : ScriptIntrinsic(rs, RS_SCRIPT_INTRINSIC_ID_INTER_PRED, e) { +} + +void ScriptIntrinsicVP9InterPred::forEach(sp<Allocation> asize) { + if (asize->getType()->getElement()->isCompatible(mElement) == false) { + mRS->throwError(RS_ERROR_INVALID_ELEMENT, "InterPred forEach element mismatch"); + return; + } + Script::forEach(0, asize, NULL, NULL, 0); +} + +void ScriptIntrinsicVP9InterPred::setRef(sp<Allocation> ref) { + sp<const Type> t = ref->getType(); + if (!t->getElement()->isCompatible(mElement)) { + mRS->throwError(RS_ERROR_INVALID_ELEMENT, "setRef element does not match"); + return; + } + Script::setVar(0, ref); +} + +void ScriptIntrinsicVP9InterPred::setParam(sp<Allocation> param) { + sp<const Type> t = param->getType(); + if (!t->getElement()->isCompatible(mElement)) { + mRS->throwError(RS_ERROR_INVALID_ELEMENT, "setFriParam element does not match"); + return; + } + Script::setVar(1, param); +} + +void ScriptIntrinsicVP9InterPred::setParamCount(int fri, int sec, int offset) { + FieldPacker fp(12); + fp.add(fri); + fp.add(sec); + fp.add(offset); + Script::setVar(2, fp.getData(), fp.getLength()); +} + sp<ScriptIntrinsicBlend> ScriptIntrinsicBlend::create(sp<RS> rs, sp<const Element> e) { if (e->isCompatible(Element::U8_4(rs)) == false) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic"); |
