merge what works better from Linaro framework_av

Change-Id: I6af13a7bb22b6090f05d6b8d94c3e2f29d866123
merge what works better from Linaro framework_av courtesy of Root-Box

Change-Id: I8c03e210e59f055dd93636a241eaa0f8d7d929be