Related to your second question, the huffy output by avs2yuv is kinda broken (srsly, try avs2avi or something else instead) but usually avisource is fine in avisynth. As for lossless codecs, see UTVideo or Lagarith or FFV1 or VBLE, depending on your needs. I suppose I recommend them in that order, although if you know exactly what you're doing and how internals and some heavy video theory work, VBLE is the best option. If editing in Linux or a mac, try FFV1, or UTVideo if your app is in OSX and using QT. Y4M is just a raw YUV file with some headers (interlacing, framerate, resolution, AR) so technically not a codec as such.