Let’s Talk x265

Say if I made a video addon that streamed perfectly legal YouTube videos. Could I put a x265 decoder within the video addon. So when the user calls upon the x265 video file the decoder can stream the file. Thus keeping quality the same & lowering bit rates and buffering?

Or could you eventually integrate it natively into the Kodi player?